1 Reply Latest reply on Jul 28, 2011 7:15 PM by Sean McGilbert

    can someone help me? i desperately need a script to highlight duplicate phone numbers in a PDF.

    fushyuma

      can someone help me? i desperately need a script to highlight duplicate phone numbers in a PDF.

        • 1. Re: can someone help me? i desperately need a script to highlight duplicate phone numbers in a PDF.
          Sean McGilbert

          At what point do you want the numbers to be highlighted? Immediately after a user enters the number? When they submit the form?

           

          If you wanted the form to highlight as soon as the user entered the number, I would add this script to the calculate area of one of the phone number fields. I want matching fields to turn red and non-matching to turn yellow.

           

           

          //gather up the data
              var phnum1 = this.getField('PhoneNumber01');
              var phnum2 = this.getField('PhoneNumber02');

           

          //test to see if fields are empty or if they dont match
             if (((event.value=="")&&(phnum2.value==""))||((event.value)!=(phnum2.value)))
                  {
                      //in the event of this, make fields yellow
                      phnum1.fillColor = ['RGB', 1, 1, 0];
                      phnum2.fillColor = ['RGB', 1, 1, 0];
                  }
               else if ((event.value)==(phnum2.value))
                  {

                  //display a notification if they match
                  app.alert('Please revise '+phnum1.name+' is the same as '+phnum2.name);
                  //colour the duplicates red
                  phnum1.fillColor = ['RGB', 1, 0, 0];
                  phnum2.fillColor = ['RGB', 1, 0, 0];     
                  }
              else {}