Reset button does not reset field color.

Avatar

Avatar

LegendGraphics

Avatar

LegendGraphics

LegendGraphics

16-11-2011

Can't find the solution.

I have scripts that highlight the field background color if the value is out of range.  Also, resets the color back if the range is OK.  This works just fine.

When I reset the form (with button), the field values reset OK, but the field color stays highlighted if that was the state.

The form initially opens with no hightlighting.  How do I reset the form values and remove the highlighting?

Thanks,

Wendell

View Entire Topic

Avatar

Avatar

Steve_L_Walker

Avatar

Steve_L_Walker

Steve_L_Walker

16-11-2011

You can add code to the reset button click event to set the colour back to the background colour of the form. For example, the following code checks if the border fill colour is "51,153,102" (green). If it is, set it to "255,255,255" (white).

//form1.page1.subform1.resetBtn::click - (JavaScript, client)

xfa.host.resetData();

if (xfa.resolveNode("form1.page1.subform1.bar.ui.#textEdit.border.fill.color").value == "51,153,102") {

          xfa.resolveNode("form1.page1.subform1.bar.ui.#textEdit.border.fill.color").value = "255,255,255";

}

Steve