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

    Likes Received:
    Best Answers:
    Trophy Points:
    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

    Likes Received:
    Best Answers:
    Trophy Points:
    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");
    event.value = 0;
    this.getfield("CheckBox1").checkThisBox(0,event.target.value= "Off");
    KLG, Jan 7, 2019 IP