Skip to main content
Participant
August 13, 2015
Question

Auto populate check box

  • August 13, 2015
  • 1 reply
  • 245 views

I want to put many check boxes on a form.  However, I also want the ability that if you click one check box it will auto populate another.  Can we do this?

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

1 reply

Anubha Goel
Participating Frequently
August 14, 2015

Hey bhilyardthurston,

You might need to set the value of a field in the Mouse Up event of a check box and do this:

// Set the value of a text field to the export value of this check box if selected

var val = event.target.value;

var f = getField("Text1");

if (val !== "Off") {

    f.value = val;

} else {

    f.value = "";

}

This code will work with a radio button group, check box, combo box (dropdown) and listbox if the export value of the check box match the button/export value of the other field, but the last line should be changed to:

f.value = "Off";

for radio buttons and check boxes, and the default value for combo boxes and listboxes.

Hope this helps.

Regards,

Anubha