Setting Form Field Properties Programatically
Setting form field properties using JavaScript can automate the process
If you will be setting form field properties while creating and positioning a form field programatically using the addField method you should first define a variable for the field by running the following script in the console like this:
var f = this.addField("MyField", "text", 0 , [0, 18, 72, 0]);
Now you can use f instead of typing this.getField("MyField") for each field property you are going to set:
f.alignment="center"; //sets the field alignment to center
f.fillColor=color.yellow; //sets the fill color of the field to yellow
f.textColor=color.blue; //sets the text color of the field to blue
f.textFont="Times-Bold"; //sets the font of the field to Times Bold