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

Populate a text field based on checkbox value

Community Beginner ,
Nov 14, 2018 Nov 14, 2018

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
1.9K
Translate
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 = ""; 

}

Translate
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 = ""; 

}

Translate
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
Community Beginner ,
Nov 16, 2018 Nov 16, 2018
LATEST

Thanks, that worked!

Translate
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