3 Replies Latest reply on Jan 19, 2012 7:02 AM by akshayny1

    Clear form Option resets read only properties

    akshayny1 Level 1

      Hey guys,

                           Using your help I got my problem solved last time. So when I have a series of Questions, I set all questions to read only in their properties except the first Question. Once the first question is answered, using the script below, I then set read only for the next question to false and students can answer the next question now. So using this pattern, it allows them to answer one question after the other without skipping any.


      The Mouse Up action for each "Radio Button1" could be:


      if(event.value != "Off") this.getField('Radio Button2').readonly = false;


      Now, while this works perfectly for time being, I keep experimenting with this form with lots of modifications made as needed. When I use the "clear form" Option to empty all the form fields before saving it, all the read only Questions reset and now when we close and re open the file, any question can be answered and the script used above has no more value.


      What is the script needed here to avoid the read only questions to reset when i use the clear form option. Please help me out here!

        • 1. Re: Clear form Option resets read only properties
          gkaiseril MVP & Adobe Community Professional

          Clear the form menu action or the "this.resetForm();" script only resets the values of the fields.


          You script will one execute when there is a Mouse Up action, and if a radio button or check box is set to read only then there can be no field actions. The field is locked to user interaction and can only be manipulated by JavaScripts.


          There is no trap for the reset or clear action so even if you created a button to reset and clear the form fields with the read only property set, you would still have the issue of the user using the menu option. You can add a document level script to clear the read only property of fields when the form is opened.

          • 2. Re: Clear form Option resets read only properties
            enomail Level 1

            Hi  akshayny1


            I don't think Adobe Reader has the option to clear the form.

            Are you using the drop down menu in Acrobat to clear the form?  If so I think that will clear every thing.

            You can use the OK button to create a field to Clear the Form.

            Then go to properties and choose Actions, then Reset a Form.

            Then uncheck the fields you don't want to be cleared.

            This will work in Reader.


            Ron A

            • 3. Re: Clear form Option resets read only properties
              akshayny1 Level 1

              yes, you're right. I dont think I'll have any issue with the reader and if anything I'll just create a button to clear fields if needed.. Thanks for all the help!