Skip to main content
Known Participant
June 21, 2016
Answered

fill in multiple fields based on check box

  • June 21, 2016
  • 3 replies
  • 1201 views

(another newb questions...)

Like to fill in several form fields based on whether or not a checkbox is checked.

I have it working now using individual calculated scripts in the individual field. for example:

if (this.getField("checkbox").value=="Off") { 

    event.value = null; 

} else { 

    event.value = "ABCXYZ"; 

} 

However, it is possible to assign the value(s) just from the CheckBox field itself?

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer try67

Yes, you can do it from the MouseUp event of the check-box field. It will look something like this:

if (event.target.value=="Off") {

    this.getField("Text1").value = "";

    this.getField("Text2").value = "":

} else {

    this.getField("Text1").value = "ABCXYZ";

    this.getField("Text2").value = "123456":

}

3 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 21, 2016

Yes, you can do it from the MouseUp event of the check-box field. It will look something like this:

if (event.target.value=="Off") {

    this.getField("Text1").value = "";

    this.getField("Text2").value = "":

} else {

    this.getField("Text1").value = "ABCXYZ";

    this.getField("Text2").value = "123456":

}

HambergAuthor
Known Participant
June 21, 2016

OK 67 - you are my favorite coder for the whole rest of the week!!