Copy link to clipboard
Copied
Hi all,
I have done research and found answers for drop down dependency lists, however my example i need help with is i have a new form, from the drop down list if you select new , or returning from the drop down list i would like the check boxes which are visible below to preselect certain check boxes as the requirements will change between new and returning.
any help, thank you in advance.
Copy link to clipboard
Copied
Use this:
for(var i=1; i<=15; i++){
if(event.value == "New")
this.getField("course "+i).checkThisBox(0,true);
else if(event.value == "Returning"){
this.getField("course "+i).checkThisBox(0,false);
if(i==1 || i==3)
this.getField("course "+i).checkThisBox(0,true);}
else if(event.value == "Soon"){
this.getField("course "+i).checkThisBox(0,false);
if(i>=5&&i<=8)
this.getField("course "+i).checkThisBox(0,true);}
else
this.getField("course "+i).checkThisBox(0,false);}
Copy link to clipboard
Copied
So you want to check checkboxes if either 'New' or 'Returning' is selected from dropdown?
Lets say checkboxes are named "New" and "Returning", you can use this as validation script of dropdown field:
this.getField("New").checkThisBox(0, event.value == "New" ? true : false);
this.getField("Returning").checkThisBox(0, event.value == "Returning" ? true : false);
Copy link to clipboard
Copied
Hi Nesa,
Thank you for replying.
So i have 5 things in the drop down.
New
List
Soon
Returning
Finish
and i have around 15 different things in the checkbox on same page of form.
course 1
course 2
course 3
upto course 15
I would like for example, if new is select that all check boxes are ticked but if returning is select only check box 1 and 3 are ticked.
If soon is ticked and then check box 5-8 is ticked?
Copy link to clipboard
Copied
Use this:
for(var i=1; i<=15; i++){
if(event.value == "New")
this.getField("course "+i).checkThisBox(0,true);
else if(event.value == "Returning"){
this.getField("course "+i).checkThisBox(0,false);
if(i==1 || i==3)
this.getField("course "+i).checkThisBox(0,true);}
else if(event.value == "Soon"){
this.getField("course "+i).checkThisBox(0,false);
if(i>=5&&i<=8)
this.getField("course "+i).checkThisBox(0,true);}
else
this.getField("course "+i).checkThisBox(0,false);}
Copy link to clipboard
Copied
Thank you so much Nesa. This worked perfectly.

