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

saving user selections to allow continuation of user form filling

goodbye
Registered: Jul 7 2008
Posts: 49
Answered

condensed edit: what event can I use when a user reopens a form to return the shown/hidden subforms state they left off at? (docReady, form:ready, and layourt:ready did not work)

if (this.rawValue == "1") {
mySubform.presence = "visible";
}
else {
MySubform.presence = "hidden";
}

Or is this the wrong approach? Seems this is the same as setting and reading a variable? :(

original post:

I thought I had this figured out but . . . I have a really long form with many hidden subforms that are revealed with radio buttons. It's just a series of "Do you need this?" with radio buttons for "Yes", "No", "I am not sure".

If they select "I am not sure", another subforms opens and may either have an explanation or another set of questions. Some subforms are nested 4 and 5 deep.

The user needs to be able to open the form, work on it, then reopen and continue. One great answer here pointed me in the right direction but I have stumbled again.

I am using docReady event to set initial states, but maybe that is wrong? And I use docReady to check what the user selected when they reopen the form. Is form:ready more appropriate and is my code approach sound?

Here is a sample of my flawed code:

TopmostSubform.Page1.haveGuestrooms.havePMS::docReady - (JavaScript, client)
this.presence = "hidden";
if (this.rawValue == "1") {
pmsInterface.presence = "visible";
}
else {
havePMS.presence = "hidden";
havePMS.RadioButtonList.rawValue = "";
havePMS.pmsInterface.presence = "hidden";
havePMS.pmsInterface.RadioButtonList.rawValue = "";
havePMS.pmsInterface.connector.presence = "hidden";
havePMS.pmsInterface.connector.rawValue = "";//this is a drop-down list
}

Then the actual code that allows them to change values is on the change event as such:

TopmostSubform.Page1.haveGuestrooms.havePMS.RadioButtonList::change - (JavaScript, client)
if (this.rawValue == "1") {
pmsInterface.presence = "visible";

}
else {
havePMS.pmsInterface.presence = "hidden";
havePMS.pmsInterface.RadioButtonList.rawValue = "";
havePMS.pmsInterface.connector.presence = "hidden";
havePMS.pmsInterface.connector.rawValue = "";//drop-down list
}

The change event code works great, but when I open the form in Acrobat 9 and save with "Extend Features in Adobe Reader . . .". Then go open it (on another machine without LCD ES, the data is saved, but the last state of shown subforms is not. So a question that revealed a hidden subform and then that subform had a value checked will still hold those values but it will be hidden again when closed and reopened. It needs to stay visible to the user so they can continue filling out the form at a later time.

Any insight would be greatly appreciated to my approach. Thank you.

My Product Information:
LiveCycle Designer, Windows
goodbye
Registered: Jul 7 2008
Posts: 49
well I will answer myself, lots of trial and error and it seems that I have a very simple solution

could it be as simple as under document properties > Defaults and select "Automatically" for Preserve scripting changes?and setting the "hidden" subforms as hidden via their Presence in the Object palette rather than on the docReady event

if this sounds whacked, please let me know. thanks

seems to "remember" the user selections as to what was shown by their selections.
scottsheck
Registered: May 3 2007
Posts: 138
Yes, you are correct, it's that simple, but I thought you change it to Manual not automatic. But it is either automatic or manual that does the trick. Luckily there is such as setting
goodbye
Registered: Jul 7 2008
Posts: 49
thanks scottsheck. i will try manual as well. i have found this very difficult to understand and locate. i do actionscript all day long, but found information describing these features to be lacking

i think the Automatically works for me because I am only using client side JS on forms the user will be filling out on their machines.

thank you for the answer, it does not feel like such a lonely struggle :)