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

Click button to empty checkbox

scderacjor
Registered: Mar 27 2009
Posts: 123
Answered

I'm hoping there is a way to create a button that unchecks a certain check box without having to use the resetData or remerge codes. Unless I am using those incorrectly, they are setting the entire form to initialize even though I have it set to only reset a few text fields. The only things it does not reset is what the user input into a text field that is not contained within the

xfa.host.resetData("this,this,this");

So, if I could create a code for a button to uncheck one check box, I think I can make this work.
I'm thinking something like the following, under the click function of the button:

Checkbox1.rawValue == "0" (or false, or off.. not sure what to use)

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You should be able to use:
xfa.host.resetData("form1.#subform[0].CheckBox1")
You may need to adjust for the form and subform references.

George Kaiser

scderacjor
Registered: Mar 27 2009
Posts: 123
It worked for this little one with only two check boxes and one reset button, however my other reset button (within the same form) resets the ENTIRE form. I'll try to condense it into a more refined subform.

Thanks, gkaiseril!
scderacjor
Registered: Mar 27 2009
Posts: 123
Actually, even though I only have two items in the ("X"), it still resets the other items.

Although this is an accepted answer and it does work, it doesn't work for what I want, so I'm still looking for the coding for switching a check box from on to off without the reset.
scderacjor
Registered: Mar 27 2009
Posts: 123
FOUND IT:

For future reference, this is VERY simple.

under the button click* function:
CheckBox1.rawValue = false;