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

addfield multiple textfield - line break

heinzeckert
Registered: Dec 6 2008
Posts: 14
Answered

I´ve created by addField a multiple textfield.

But by creating this textfield ive come to a problem.
I cannot create a line break in this textfield.
I thought that I can do this with "\n" or "\r".

var f = this.addField("response", "text",
page = this.pageNum = 2,[10,10,595,840]);

var ausgabe = ("Question 1 " + var1 +"% \n" + "Question 2 " + var2 +"% \n")

f.value = (ausgabe);
f.textSize = 12;
f.textfont = font.Helvtica;
f.textColor = color.black;
f.fillColor = color.white;
f.alignment = "left";
f.multiline = true;
f.readonly = true;

Can somebody help me and tell me how i can create a line break in this multiple textfield, please?

Thank you for your help,
Heinz Eckert

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Are you getting any messages in the JavaScript debugging console?

I receive the following:

f has no properties
6:Console:Exec
f has no properties
6:Console:Exec
undefined

Because the "addField()" page parameter is not properly specified. For JS page 2:

var f = this.addField({cName: "response", cFieldType: "text", nPageNum: 2, oCoords: [10,10,595,840] }); // get response valuesvar var1 = this.getField("Field1Name").value;var var2 = this.getField("Field2Name").value; // text for valuevar ausgabe = ("Question 1 " + var1 +"% \n" + "Question 2 " + var2 +"%") f.textSize = 12;f.textfont = font.Helvtica;f.textColor = color.black;f.fillColor = color.white;f.alignment = "left";f.multiline = true;f.value = (ausgabe);f.readonly = true;

I also had to redorder the setting of the properties to place the "value" after the "muyltiline" property was set to 'true".

George Kaiser

heinzeckert
Registered: Dec 6 2008
Posts: 14
Thank you a lot!