Skip to main content
Participant
November 14, 2018
Answered

Populate a text field based on checkbox value

  • November 14, 2018
  • 1 reply
  • 2151 views

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

This topic has been closed for replies.
Correct answer subieguy2

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

}

1 reply

subieguy2
subieguy2Correct answer
Inspiring
November 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 = ""; 

}

Participant
November 16, 2018

Thanks, that worked!