The example demonstrates how to manipulate the visual properties of an object; in this case, a text field. For example, selecting the Make the Field Wider check box expands the fillable area of the text field to four inches.
Livecycle common scripting tasks.106.5.1 Changing the visual properties of an object on the client
In this example, the check boxes do not have unique object names; therefore, LiveCycle Designer ES assigns an instance value to reference the object. The check box script uses an if-else statement to give the effect of selecting and deselecting.
TextField.x =”3.0in”;
TextField.y =”3.5in”;
}
TextField.x = “1in”;
TextField.y = “3in”;
}
TextField.w = “4in”;
TextField.w =”2.5in”;
TextField.h =”1.5in”;
TextField.h =”0.5in”;
TextField.border.edge.color.value = “255,0,0″;
TextField.border.edge.color.value =”255,255,255″;
xfa.resolveNode(“TextField.ui.#textEdit.border.fill.color”).value = “0,255,0″;
}
xfa.resolveNode(“TextField.ui.#textEdit.border.fill.color”).value = “255,255,255″;
}
When the check box is selected, the fillable area of the text field adjusts to accommodate the value. When the check box is deselected, the fillable area of the text field does not adjust.
TextField.minW =”0.25in”;
TextField.maxW =”2.5in”;
TextField.presence =”hidden”;
TextField.presence =”visible”;
TextField.font.typeface =”Courier New”;
TextField.font.typeface =”Myriad Pro”;
TextField.font.size =”14pt”;
TextField.font.size =”10pt”;
TextField.para.vAlign =”top”;

else

TextField.para.vAlign =”middle”;
Scripting for the Align Text Field Value Horizontally check box
When the check box is selected, the text field value is aligned to the center. When the check box is deselected, the text field value is aligned to the left.
if (CheckBox11.rawValue == true)
TextField.para.hAlign =”center”;
else
TextField.para.hAlign =”left”;
Scripting for the Display a Set Value check box
When the check box is selected, the value that is defined by using a script appears in the text field. When the check box is deselected, the default value (which is also defined by using a script) appears in the text field.
if (CheckBox12.rawValue == true)
TextField.rawValue = “This is a value set using a script.”;
else
TextField.rawValue = “This is a default value.”;
Scripting for the Change the Caption Text check box
When the check box is selected, the alternate caption text that is defined by using a script appears as the caption. When the check box is deselected, the default caption (which is also defined by using a script) appears in the text field.
if (CheckBox13.rawValue == true)
xfa.resolveNode(“TextField.caption.value.#text”).value = “Alternate Caption:”;
else
xfa.resolveNode(“TextField.caption.value.#text”).value = “Caption:”;
Scripting for the Change Field Border from 3D to Solid check box
When the check box is selected, the field border changes to a solid box. When the check box is deselected, the field border changes to 3D.
if (CheckBox14.rawValue == true)
xfa.resolveNode(“TextField.ui.#textEdit.border.edge”).stroke = “solid”;
else
xfa.resolveNode(“TextField.ui.#textEdit.border.edge”).stroke = “lowered”;
Scripting for the Clear All Check Boxes button
Use the resetData method to reset all of the check boxes to their default value (Off).
xfa.host.resetData();
Use the remerge method to remerge the form design and form data. In this case, the method effectively returns the text field to its original state.
xfa.form.remerge();
See also 
Changing the fill color of a field

Changing the visual properties of an object on the client