3 Replies Latest reply on Oct 31, 2015 8:19 AM by try67

    Evaluator Checkboxes on Multiple pages


      I'm working on a form that is used to track the progress towards completion of tasks for qualifications on a specific job.  It has been used for years as a normal pen and paper version, but I'm taking it to be able to be completed totally electronically with digital signatures. 

      I'm using Adobe Acrobat XI Pro and originally converted from a MS Word form and then deleted the extra fields, added the ones that were needed to make is so they can merely check off items on the evaluator pages.

      I've created a series of checkboxes on each of three evaluator pages, since most people cannot get all accomplished under one evaluator.  The checkboxes already have a JavaScript using an if/else statement that completes the tasks sign offs with the evaluator information, but I want to lock down the checkboxes on the second and third evaluator when the first one checks and then digitally signs the first evaluator record.  I tried using the Show/Hide function, by hiding the check box on the 2nd & 3rd page (and 3rd page from the 2nd), but when I test as an evaluator who has made a mistake, and then uncheck the box on the 1st evaluator record, the 2nd & 3rd pages checkboxes are still hidden.  I then tried to add readonly status in the If/Else JS, but I get a syntax error in the Else portion changing the read only back to false.


      So, how do I either use what is already built in with the show/hide, but when they uncheck the box, it cancels the "hide" or I need help correcting the syntax on the following script.



      if (event.target.value!="Off") this.getField(“Check Box1-1”).readonly = true, this.getField(“Check Box1”).readonly = true


      else this.getField(“Check Box1-1”).readonly = false, this.getField(“Check Box1”).readonly = false;

      I'm not a programmer now, but did Fortran and COBOL back in the 80's, so understand the basics, but don't understand my syntax error in the statement.

        • 1. Re: Evaluator Checkboxes on Multiple pages
          try67 MVP & Adobe Community Professional

          You're almost there... A comma is not a valid end-of-line character in JS. A semi-colon is. And you have to make sure you use only standard double-quotes, not any "fancy" ones, for your code to work. It might be a good idea to read a tutorial about the core JS syntax, like this one: http://www.w3schools.com/js/default.asp


          Here's a fixed version of your code:

          if (event.target.value!="Off") {
              this.getField("Check Box1-1").readonly = true;
              this.getField("Check Box1").readonly = true;
          } else {
              this.getField("Check Box1-1").readonly = false;
              this.getField("Check Box1").readonly = false;
          • 2. Re: Evaluator Checkboxes on Multiple pages
            HMCMTurner Level 1

            Thank you, that worked.  The quotes were funny because I was working to get it correct in Word before copying into Acrobat Properties.  I moved into Notepad to resolve any funny character.


            It was interesting that the way I had the code before worked for copying two fields to another two fields, separated by a comma on the same line.  I guess the line just got too long.  I will check that website to help me with future projects, but I think saving this version of the code will definitely help me with most of those projects, as it will either be adding lines or changing field names.


            Once again, I appreciate the help and fast response.

            • 3. Re: Evaluator Checkboxes on Multiple pages
              try67 MVP & Adobe Community Professional

              Yeah, Word is not a suitable application for writing code. Stick with plain-text editors, like Notepad, or my favourite, Notepad++.