Skip to main content
Known Participant
Jun 21, 2016 1:53 PM UTC
Answered

fill in multiple fields based on check box

(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.
try67
try67Correct answer
Community Expert
Jun 21, 2016 2:05 PM UTC

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
Jun 21, 2016 2:05 PM UTC

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":

}

Translate
HambergAuthor
Known Participant
Jun 21, 2016 2:26 PM UTC

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

Translate