3 Replies Latest reply on Apr 3, 2014 4:25 AM by try67

    Script Req. need help

    azsiddiqui77

      Dear All

       

      I need your help to writ script in one of our PDF form. I am not a developer so need your help.

       

      I have one form with 3 chk boxes and i need these boxes should be select at the time of print or save other wise msg box will be appear.

       

      Thanks

      AZS

        • 1. Re: Script Req. need help
          try67 MVP & Adobe Community Professional

          You can use something like this as the Will Print and Will Save events of your file. Keep in mind that you can't actually prevent the file from being printed or saved in this way, just show the error message.

           

          if (this.getField("CheckBox 1").value=="Off" || this.getField("CheckBox 2").value=="Off" || this.getField("CheckBox 3").value=="Off") {

              app.alert("You should tick all three check-boxes.");

          }

           

          Of course, adjust the names of the fields in the code to match those in your file, and you can adjust the error message, if you wish.

          • 2. Re: Script Req. need help
            azsiddiqui77 Level 1

            Dear Gilad

             

            Thanks..... it is working but I am still having a prb. with the form. When  a chkbox  is left blank, an error appears saying that "no box should be left blank" but as soon as I click "ok" it gets printed automaticaly, It should be return on form.

             

            Please help

            • 3. Re: Script Req. need help
              try67 MVP & Adobe Community Professional

              As I wrote, you can't prevent the print command if it's done via the built-in Print function under the File menu.

              You can only do that if it's done via a button that you add to your file.