These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Help with Script changing Multiline option

excelgeek
Registered: Nov 3 2007
Posts: 44
Answered

Hi
I am trying to change all the field in the document to multiline. There are 50 pages and i would like to do it with a script. The script below works on any field that begins with a number but not the fields that begin with a Letter. Please advise if you have a solution.

for (var i=0; i

My Product Information:
Acrobat Pro 9.3.1, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
The multiline property is only available for fields with a field type of 'text'.

What is the type of field for first field starting with an alphabetic letter?

Are you getting any error messages in the Acrobat JavaScript console?

George Kaiser

excelgeek
Registered: Nov 3 2007
Posts: 44
If the field name is "1text" it works but if it is named "text1" it doesn't. It only works on the field beginning with a number name. No error messages. This is in Adobe Acrobat 8 Pro not livecycle.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
The name of the field has no relevance. As gkaiseril said, you need to check the field's type, like so:
for (var i=0; i<this.numFields; i++){var fname = this.getNthFieldName(i);var f = this.getField(fname);if (f.type=="text") f.multiline = true;}

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

excelgeek
Registered: Nov 3 2007
Posts: 44
Works Great... Thanks!
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
excelgeek wrote:
If the field name is "1text" it works but if it is named "text1" it doesn't. It only works on the field beginning with a number name. No error messages. This is in Adobe Acrobat 8 Pro not livecycle.
When I run your script on a form with other than just text type fields I get the follownig error:
[quote]for (var i=0; i

George Kaiser

excelgeek
Registered: Nov 3 2007
Posts: 44
Thank you gkaiseril .. Try's answered worked just fine. I must say that your Scripting ability is amazing!