3 Replies Latest reply on Mar 19, 2013 11:25 AM by George_Johnson

    if then statement code help

    delakath

      I'm working on a PDF adding forms for the first time.

       

      I've been reading around and trying to code, but none of it is working for me.

       

      My boxes are named "InsulinResistScore" and "Severity"

       

      If InsulinResistScore is less than 29, then Severity = good

      If InsulinResistScore is less than 39, then Severity = mild

      If InsulinResistScore is less than 59, then Severity = moderate

       

      and so on....

       

      I can't seem to get this to work and just the number "0" is in Severity.

       

      Thanks.

      Kathy

        • 1. Re: if then statement code help
          gkaiseril MVP & Adobe Community Professional

          What is the code you are trying to run?

           

          Do you have any errors in the JavaScript console?

           

          I am not familiar with the field type of "Box". There are text fields, combo box, list box, and check box and they do not all behave the same way so knowing the exact type of form field and value or values is important for writing any script or program. Also, if you use a  list box or combo box for selecting an item for a list of choices, you might not even need an "if" statements since those 2 fields have an option to specify the export value for that selection.

          • 2. Re: if then statement code help
            delakath Level 1

            Oh sorry.


            They are text fields.

             

            And I did receive errors on a couple that I tried and then no errors on others and they still didn't work.

             

            Thank you so much!

             

            Kathy

            • 3. Re: if then statement code help
              George_Johnson MVP & Adobe Community Professional

              Can you post a script that you've tried? You would normally use a custom calculation script for the Severity field for this.