1) From LiveCycle Designer, open the “Dynamic Purchase Order” sample form (Purchase Order Dynamic.xdp).
2) Select the Quantity field (numQty).
3) Select and the “exit” event if a user will be entering data in the field or select the “initialize” event when the field is populated with data.
4) Copy and paste the following script into the Script Editor and edit the fill color to suit your purpose. If you would like the fill color to change for both user entered data and populated data, copy and paste the script into both the “exit” and “initialize” events.
if (this.rawValue >= 100) //red
this.fillColor = “255,0,0”;
this.fillColor = “255,255,0”; //yellow
5) Test the script using the Preview PDF tab.
Use a numeric field with this script.
Make sure that the “Preview Adobe XML Form As” property (in Form Properties) is set to “Dynamic XML Form”.
Use the “initialize” event to make the fill color change when the form is populated with data.
Use the “exit” event to make the fill color change when a user enters data.
For more LiveCycle Designer scripting samples, visit the LiveCycle Developer Center at http://www.adobe.com/devnet/livecycle/designer_scripting_samples.html/.