• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Populate a text field based on checkbox value

New Here ,
Nov 14, 2018 Nov 14, 2018

Copy link to clipboard

Copied

I am new to this and have a question.I am populating a field value to a different field based on a checkbox value. Scenario - add a name in text field. Then if I check box A, the value from the text field populates a text field in section A.  If I check box B the value from the text field populates a text field in section B.  I can get the values to populate when I check the box, but how do I clear the value if I uncheck the box?  Thanks

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Nov 15, 2018 Nov 15, 2018

Something like this might help get you started...

var checkBoxOne = this.getField("Check Box1").value;    

 

if (checkBoxOne == "Yes"){ 

    this.getField("Field One").value = "The box is checked"; 

}   

if (checkBoxOne == "Off"){ 

    this.getField("Field One").value = ""; 

}

Votes

Translate

Translate
Engaged ,
Nov 15, 2018 Nov 15, 2018

Copy link to clipboard

Copied

Something like this might help get you started...

var checkBoxOne = this.getField("Check Box1").value;    

 

if (checkBoxOne == "Yes"){ 

    this.getField("Field One").value = "The box is checked"; 

}   

if (checkBoxOne == "Off"){ 

    this.getField("Field One").value = ""; 

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 16, 2018 Nov 16, 2018

Copy link to clipboard

Copied

LATEST

Thanks, that worked!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines