3 Replies Latest reply on Apr 27, 2011 12:49 PM by beautumn

    Enforce required fields


      Hi, I am working on a editable PDF form that includes several required fields. I tried several ways to enforce the users to fill them before saving it:


      1. Mark them as "required" , but it doesn't do anything. My understanding is those required fields will only be checked when the form is submitted. Since the form does not have any "submit" button, it won't be checked


      2. Use "Custom validatioin script" to validate the field.


      3. Use a javascript on "On-blur" event.


      It seems both 2 and 3 can check if the field is blank or not when the mouse leaves the require field. But when the user skip this required field, say, the user don't click the field at all, the scripts used in 2 or 3 are not triggerd. Thus the user can save the document still with blank fields.


      How should I prevent it from happenening? And advice would be highly appreciated/







        • 1. Re: Enforce required fields
          George_Johnson MVP & Adobe Community Professional

          You cannot prevent someone from saving a document based on the value of one or more form fields, if that's what you want.

          • 2. Re: Enforce required fields
            gkaiseril MVP & Adobe Community Professional

            First, the 'submit' with regard to the 'requite' field property, is a submit to a web server scripting page, not a 'submit' button.


            So do you want your users to only to be able to save the form if they complete the form?


            Then lock them into a loop to the uncompleted field until they complete the field. Not a very user friendly approach.


            There is a 'will save' action that can also check for the completion of required fields. You will need to decide what action you want taken, but you can not stop the save action.


            You could:


            Erase the data.

            Mark the form as incomplete.

            Have an alert window pop-up.


            You can not also stop one from printing an incomplete form through the 'Will Print' action.


            You may need to write a document level script to check all of the required fields and take some action as needed. This could be used by a number actions like will save, will print, email form, submit to a web server.

            • 3. Re: Enforce required fields
              beautumn Level 1

              Thanks all for your reply.


              I used the Document Will Save event to give users warning before they save the document and set focus back to the first un-filled required field


              Combined with the "on-blur" event on each individual required field, I think it could eliminate most unfilled fields.


              Thanks again,