1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PDF Range and Checkboxes

Discussion in 'JavaScript' started by KLG, Dec 19, 2018.

  1. #2
    I am so painfully new at this - if this is the wrong area to post, let me know. I am working in a PDF (when mouse up, run a javascript) and would like the following:
    If textfield1 contains 3-37 then checkbox1 is on/checked
    if textfield1 contains 38-46 then checkbox2 is checked
    if textfield1 contains 47-55 then checkbox3 is checked
    if textfield1 contains >56 then checkbox4 is checked

    It seems simple enough, but my brain can't get it to work.
     
    KLG, Dec 19, 2018 IP
  2. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #3
    You need to do a if-else condition. So google "pdf javascript if else with numbers" and then google "pdf javascript checkbox". It doesn't seem like you have tried that yet. Do you have actual code to debug or no idea where to start? A good start would be searching those phrases
     
    NetStar, Dec 20, 2018 IP
  3. KLG

    KLG Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    Thanks for the tips, but I've obiviously in over my head, I'm not getting an error but I am also not getting a check:

    if (this.getField("CheckBox1").value!="Off")
    {this.getField("TOTAL1").value = 37
    this.getField("CheckBox1").checkThisBox(0,event.target.value= "On");
    }
    else{
    event.value = 0;
    this.getfield("CheckBox1").checkThisBox(0,event.target.value= "Off");
    }
     
    KLG, Jan 7, 2019 IP