5 Replies Latest reply on Apr 16, 2014 1:33 PM by MatLac

    Unsupported error with checkboxes

    MatLac Level 1

      I have a bunch of checkboxes numberded from 13 to 24.  two more are supposed to control the previous

       

      var clueNot = this.getField("OPE038.CLUE.NOT");
      var clueAct = this.getField("OPE038.CLUE.ACT");

       

      //this works

      if ((clueNot.isBoxChecked(0) == true) || (clueAct.isBoxChecked(0) == true)){
      for (var box = 13; box <= 24; box ++){
        this.getField("OPE038.CLUE."+box).checkThisBox(0, false);
      }
      }

       

       

      //this gets an "unsupported in this version of Acrobat" error
      for (var clbox = 13; clbox <= 24; clbox ++){
      if (this.getField("OPE038.CLUE."+clbox).isBoxChecked(0) == true){
        clueNot.checkThisBox(0, false);
        clueAct.checkThisBox(0, false);
      }
      }

       

      I changed the second part to

       

      var chkArray = new Array();

      for (var clbox = 13; clbox <= 24; clbox ++){

      if (this.getField("OPE038.CLUE."+clbox).value != "Off"){

      chkArray[chkArray.length] = this.getField("OPE038.CLUE."+clbox).value;

      }

      }

      if (chkArray.length != 0){

      clueNot.checkThisBox(0, false);

      clueAct.checkThisBox(0, false);

      }

       

      I still get the same error.  Can't see the problem?

        • 1. Re: Unsupported error with checkboxes
          try67 MVP & Adobe Community Professional

          Post the exact error message you get.

          • 2. Re: Unsupported error with checkboxes
            Bernd Alheit Adobe Community Professional & MVP

            What version of Adobe Acrobat do you use?

            • 3. Re: Unsupported error with checkboxes
              MatLac Level 1

              NotSupportedError: Fonction non prise en charge dans cette configuration d'Acrobat

              Field.checkThisBox:6:Field COTE:Calculate

               

              It's the same error message for both blocks of codes

               

              version 11.0.0.379

              • 4. Re: Unsupported error with checkboxes
                try67 MVP & Adobe Community Professional

                Are you sure all of these fields are check-boxes or radio-buttons, and not anything else?

                 

                Can you share the file?

                • 5. Re: Unsupported error with checkboxes
                  MatLac Level 1

                  I found out what the error is.  By putting my code in a calculate script, I was, in some way, trying to force checkboxes to behave just like radio buttons, having one to exlude all the others and vice versa.

                   

                  I believe the problem is that:

                  - both blocks of the code are triggered in the same event (calculate)

                  - they are (in fact) both triggered by the same condition which is: both checkboxes are checked at the same time

                   

                  Since Acrobat doesn't "remember" which was checked first, I think it creates some kind paradox forcing it to do two opposite things. 

                   

                  The solution was to separate both blocks and placing one in the MOUSE DOWN event of the checkbox. Since MOUSE DOWN happens BEFORE calculate, I can place an IF condition checking that the box is OFF (and thus knowing it's gonna change to TRUE).  The other block of code can be left in the claculate script.

                   

                  //place this in the mouse down event of the "single" checkbox

                  if (event.target.isBoxChecked(0) == false){

                  for (var box = 13; box <= 24; box ++){

                    this.getField("OPE038.CLUE."+box).checkThisBox(0, false);

                  }

                  }

                   

                  //keep this in the calculate event

                  var clueNot = this.getField("OPE038.CLUE.NOT");

                  for (var clbox = 13; clbox <= 24; clbox ++){

                  if (this.getField("OPE038.CLUE."+clbox).isBoxChecked(0) == true){

                    clueNot.checkThisBox(0, false);

                  }

                  }

                   

                  This solution might help those who need a radio button that must remain "uncheckable".  One of the problem with radio button being that once a choice is made, you cannot uncheck and have "no choice" as an option.