2 Replies Latest reply on Apr 6, 2015 11:35 AM by JohnnyBQue

    If Else question...Using Adobe Acrobat PRO X

    JohnnyBQue

      Have a form field named (RMAs) I will be entering a single value in the range of 0 thru' 5 when on of these numbers are entered a second form field named (RMAp) will display a value based on the value entered in form field (RMAs)...I've tried numerous scripts from the net none have worked...I think my main problem is how to trigger the script and what actual form field to place the script in...any help will be appreciated.

       

      I've done SOME VB stuff with Access but I know the there are syntax differences with java-script so keep it simple...

       

      also "event.value" how or what is this actually associated to? Is it data that will be assigned to or taken from a particular form field?

       

      again thanks for any help here...

       

       

      Forgot to add the script I came up with....here you go...

       

      var nRMAs = this.getField("RMAs");

      var nRMAp = this.getField ("RMAp")

      if (nRMAs.value == '0') {nRMAp.value='10'}

      else if (nRMAs.value == '1') {nRMAp.value='8'}

      else if (nRMAs.value == '2') {nRMAp.value='6'}

      else if (nRMAs.value == '3') {nRMAp.value='4'}

      else if (nRMAs.value == '4') {nRMAp.value='2'}

      else if (nRMAs.value == '5') {nRMAp.value='1'}

      else if (nRMAs.value >== '5') {nRMAp.value='0'//not sure if (>==) is correct here...I think it should be (>=) i get an error for (>==)


      Now I putting the script above in form field named RMAp under the "Actions" tab as TRIGGER- "On Blur"  and SELECTED ACTION - "Run a JavaScript"




      It just comes to show if you diddle with something long enough you'll get a result....By submitting this question to this forum and rewriting the script above I now got it to work!


      Thanks for all the help....