0 Replies Latest reply on May 12, 2016 11:40 AM by MMedina2112

    Acrobat DC Scripting

    MMedina2112

      I am new to working with forms in acrobat, and am having a hard time figuring this part out.
      If anyone can help me, I would greatly appreciate it!

       

      So I have a form that I've created in acrobat DC.

      I have an array of feilds "WeightObj 1 thru 8:" They are displayed as a percentage value using the following Java Script:

       

      // Custom Format script for text field 

      if (event.value) event.value += "%"; 

      // Document-level function 

      function DigOnlyKS() { 

       

          // Get all that is currently in the field 

          var val = AFMergeChange(event); 

       

          // Reject entry if anything but digits 

          event.rc = AFExactMatch(/\d*/, val); 

       

       

      Then the following Custom Key Strokes:

       

      // Custom Keystroke script 

      DigOnlyKS();

       

       

       

      This works like a charm but I'd like to accomplish the following:

       

      1) Limited the values in each field not to exceed 100%. (0-100)

      2) At any point if the total of the array of values exceeds 100% an alert like:

                 "The total of the individual fields can't exceed 100%"

      3) At the completion of that array of fields not totaling 100% another

      alert to warning the user that the total must be %100;

       

      I hope I am making since here.....
      Thanks and have a wonderful day!