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

Reset/Invisible text fields

patra
Registered: Oct 19 2006
Posts: 270
Answered

I have several invisible text fields which show up depend what check box user click on.
my problem it is when I click the reset button still are visible!

How I can solve this isssue to become again invisible when I hit the reset button.

Thanks

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You will need the remerge scripting method to reset the radio buttons.

Example for reset button click event:
if(xfa.host.messageBox("Do you really want to reset the form?\rAll data will be lost!", "Reset Form?",2,2)==4{xfa.host.resetData(),xfa.form.remerge();}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

hattg
Registered: Jun 18 2009
Posts: 36
This is something I am looking to do as well, but when I put this code in, I get an error that says:

missing ) after condition
2:XFA:form1[0]:P1[0]:Title[0]:ResetButton1[0]:click

Suggestions?

Thanks
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
That's right.
It seems that I missed a ) on copying this script into this thread.

Sorry for that ;)
if(xfa.host.messageBox("Do you really want to reset the form?\rAll data will be lost!", "Reset Form?",2,2)==4){xfa.host.resetData(),xfa.form.remerge();}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

PetafromOz
Registered: Jun 8 2009
Posts: 230
I don't know how critical this is but I think also there should be a semi-colon, not a comma after the second line - ie.

if(xfa.host.messageBox("Do you really want to reset the form?\rAll data will be lost!", "Reset Form?",2,2)==4)
{
xfa.host.resetData();
xfa.form.remerge();
}

from way... underground at Parkes - central West NSW - Australia

hattg
Registered: Jun 18 2009
Posts: 36
Thanks to you both. It's all good now, works like a charm!
Tim G-J
Registered: Nov 12 2009
Posts: 1
Just wish I'd found the xfa.form.remerge(); before I'd torn my hair out.

Still it has solved a similar problem

xfa.host.resetData(); will reset all the fields and remove the user submitted data
xfa.host.remerge(); will reset all the radio buttons and put hidden text back to it's original state

Thanks for the post!