Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Multiple onChange ranges in Acrobat 6?

    I am trying to write a custom script in Acrobat 6 that will set a read-only field to a certain value depending on what a user-entered value in another field is. So, if a user enters a number between 0 and 5, the read-only field becomes, say, -3. If the user enters a number between 6 and 8, the read-only field is something else. Those aren't the actual number ranges, but you get the idea.

    This is as far as I have gotten with the initial script, and being new to this, I need some help. This works fine with one range of numbers...

    var f = this.getField("second_field");
    var x = this.getField("first_field");
    if (x.value > 0 && x.value < 5)
    f.value = "-3";

    ...but I need to know how to set this up for multiple number ranges, for instance...

    If user enters 1 then second_field becomes -5
    If user enters 2 or 3 then second_field becomes -4
    If user enters 4 or 5 then second_field becomes -3

    ...And so on? Do I just add multiple lines of...

    if (x.value > ? && x.value < ?)

    ...and can I use "or" in place of "&&"? I'm totally stuck here... can anyone shine a light on this problem? Thanks...

    Cross.

  • #2
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Hrmm

    No takers, eh?

    C.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •