1 Reply Latest reply on Feb 21, 2011 6:26 AM by try67

    Validate all mandatory fields have been completed on a given page

    ClydebankCollege

      Hi,

       

      I would like some help on something that seems simple and has not been covered before (or, I cannot find the information) I would like to add a button to each page of the form Validating that the mandatory fields have been completed, before allow access to the next page for completion.

       

       

      Regards

       

      Richard

       

       

        • 1. Re: Validate all mandatory fields have been completed on a given page
          try67 MVP & Adobe Community Professional

          It's possible, but the user would still be able to move to the next page manually (although you can add a Page Close event).

          The form of your code should be something like this:

           

          var continue = true;

          if (this.getField("Field1").value=="") continue = false;

          if (this.getField("Field2").value=="") continue = false;

          if (this.getField("Field3").value=="") continue = false;

          if (this.getField("Field4").value=="") continue = false;

           

          if (continue==false) {

          app.alert("You must first fill in all of the required fields.")

          } else {

          this.pageNum++;

          }