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

save all user entered choices on client side JS

goodbye
Registered: Jul 7 2008
Posts: 49
Answered

In a multipage form created in LiveCycle ES (from CS3) I am using client side JavaScript to set some subforms as hidden on docReady as such:

this.presence = "hidden";

These fields are then shown based on radio buttons and checkboxes.

The form is filled out and saved by the client using "Extend Features in Adobe Acrobat" in Acropbat Pro 9.

I would like the person to be able to save and reopen the document, but of course, the docReady actions to hide subforms does hide those subforms that were made visible by the users previous choices.

Since it has to be self-contained (no database can be used) how can I "store" the values for what should be visible? And not have docReady over ride the users choices?

Thanks.

My Product Information:
LiveCycle Designer, Windows
formman
Registered: Jul 17 2008
Posts: 44
subquark,

I would create form variables one for each radio button group or checkbox that needs to control a subform(s).

In the click event of the RB/CBox put a statement that changes the value of the form variable from say 0 to 1. So when the RB/CBox is clicked the value in the form variable will be changed.

In the docReady event just add an if statement that looks at the value of the specific form variable controlled by the RB/Cbox. If it is 0 then keep it hidden, if it is 1 then this.presence = "visible".

Regards,

Rick Kuhlmann

Forms Developer/Designer
Tech-Pro, Inc.
Roseville, MN

goodbye
Registered: Jul 7 2008
Posts: 49
thank you very much formann. that sounds better than what I started retrofitting. I was putting "if" statements for each radio group and that was getting very cumbersome since some subforms are heavily nested (some ar 8 deep, so if you show the first hidden one, it may then have a subform to show and so on)

with your suggestion, I can just go to each docReady snippet and paste in the same code over and over, thank you