1 Reply Latest reply on Mar 19, 2014 1:34 AM by try67

    How to modify values of a textbox based on a checkbox


      Where can I find a guide to creating custom JavaScipt calculation code for Adobe Acrobat fillable forms?



      I have a fillable form that will base a textbox value on the following:



      value = 0.00;

      if checkbox1 is checked, then:

        value = value + 3.60;

      end if



      if checkbox2 is checked, then:

        value = value + 0.90;

      end if



      if textbox4 has any number in it, then:

        value = value * the number in textbox4;

      end if



      if value is NaN, then:

        value = 0.00;

      end if



      if value is 0.00, then:

        make textbox blank (clear the textbox)

      end if



      how do I do this in "custom calculation script" JavaScript?


      I tried to implement it, but the code gave an error when I tried to add to event.value a second time:


      event.value = 0;

      event.value = event.value + 3.60; // works

      event.value = event.value + 0.90; // doesn't work


      I don't understand. Why would it work on one but not the other?