I am using some some text boxes which show or hide depending on what is checked/unchecked. This all works great. The problem I am having is when someone fills the form out and then saves it as a .pdf when it is reopened the hidden fields do not show. They are still there, with their data intact. By clicking the yes/no button that activated them in the first place, they will reappear with data. Any ideas on some code I can put in to prevent this. I want the saved form to show exactly as it did when the user closed it.
In another post, Paul wrote: "You will need to keep track of the state of the form and reset it when it is opened. There was a feature added in version 9 to take care of this but that means all users have to use version 9 of Acrobat/Reader." What is that feature? And it's in Reader, correct?
I don't have LC open, but in the File / Form Properties /Defaults there is a radio button for automatically preserving / saving script changes. Tick Auto. If that doesn't work for you, try duplicating the script in the docReady event (fires once when the form is opened) and will look at the value of the radio button and take appropriate action. Not the nicest, but best I can do with the grey cells.
PS alternatively in the docReady event have the following script referencing where the main script in the radio button is located.
Thanks for the speedy reply. The automatic button certainly is enticing, but the language to the right of it, "Script-based state changes are saved locally in an insecure fashion. This option cannot be used for certified forms." looks mighty perilous. I am concerned about the intellectual property invested in this form. Does this pose a threat to preserving my hard work?
I will have a peek at doing the alternative.
I don't think you should be too alarmed. We ave certified forms and to do so you have to have the choice set to manual. To be honest the security relates to the integrity of the data (I think). Unless the data / form are highly confidential, I would stick with "auto".
Password protecting the form in properties / PDF security will protect your hard work. You can set it up that the form opens without asking for a password in Acrobat, but if someone opens it in LC then they will need the password.