4 Replies Latest reply on Sep 22, 2015 2:57 PM by gkaiseril

    How can I fix this script to only highlight missing text in form fields but also check boxes?

    ErickPPLG

      I need help with these two things:

       

      First, I found the following script elsewhere in the forum, but it doesn't work the way I need it to. It's supposed to highlight any form field -- except the signature field -- which is missing text from the person filling out the form. It also doesn't highlight the box in red, just gives it a border (and I'd prefer the latter, or both). Finally, it even highlights the current form field that did receive an entry! I don't know what's wrong with it:

       

      //Checks to see if there are any empty text fields on the page
      //If there are, it highlights them with a red border

       

      for (var i=0; i<this.numFields; i++) {
          var f= this.getField(this.getNthFieldName(i));

          if (f.value!=""){
              f.lineWidth = 0
              f.strokeColor = color.transparent   
          }

          else
          f.strokeColor = color.red;
          f.lineWidth = 2
          }

       

      Second, how do I add to the script above to also highlight missing check boxes to also be highlighted in red, and to also issue a pop-up box indicating the missing fields? I found scripts that do that here but I don't know how to combine them since I don't know how to do Javascript myself.

       

      Please help.