Skip to main content
Participating Frequently
December 17, 2019
Question

AtuoFill Checkboxes from a DropDown List

  • December 17, 2019
  • 2 replies
  • 3752 views

Hi,

Depending on my selection in the dropdown list, I would like to fill specific checkboxes with a tick.

For example, the checkbox "Monday", "Tuesday" and "Friday" should be filled by the selection in the dropdown list: "Sport". 

 

I would be very happy for your help!

This topic has been closed for replies.

2 replies

JR Boulay
Braniac
December 17, 2019

Ajust checkboxes names and place this script as a "Validation script" in the dropdown list:

 

if (event.value == "Sport") {
this.getField("mondayCheckbox").checkThisBox(0,true);
this.getField("tuesdayCheckbox").checkThisBox(0,true);
this.getField("fridayCheckbox").checkThisBox(0,true);
}
else {
this.getField("mondayCheckbox").checkThisBox(0,false);
this.getField("tuesdayCheckbox").checkThisBox(0,false);
this.getField("fridayCheckbox").checkThisBox(0,false);
}

Acrobate du PDF, InDesigner et Photoshopographe
F. Graf Author
Participating Frequently
December 17, 2019

Hi JR_Boulay,

 

thank u for ur help!! i want when someone select somethin from the drop - down list that the lower checkboxes are checked (depending on the selected modul).

 

 

 

bebarth
Braniac
December 17, 2019

Hi,

Below is a script for 6 check boxes. You have to indicates the boxes to check as export values of the drop down items.

for (var i=1; i<=6; i++) this.getField("cB"+i).value="Off";
var lesCases=this.getField("Jours").value;
if (lesCases!=0) {
var lesCases=lesCases.split(",");
for (var i=0; i<lesCases.length; i++) this.getField("cB"+lesCases[i]).checkThisBox(0,true);
}

...and the example file at:

https://we.tl/t-wWkgnUOcgr

@+

try67
Braniac
December 17, 2019

Here's a simple example of how to do it, via the Validation event of the drop-down field:

 

this.getField("Monday").checkThisBox(0, event.value=="Monday");

 

This will cause the Monday field to be checked if the value "Monday" is selected in the drop-down, and be un-checked when another value is selected.

F. Graf Author
Participating Frequently
December 17, 2019

Hi try67,

thanks for your help! Can you still tell me how the checkbox "C0" = Sport, automatically set a hook?

try67
Braniac
December 17, 2019

Sorry, I don't follow what you mean...