Need dropdown fields to populate checkbox (Yes, No)


my customer has form checkbox field called "weekendcare" options "yes" , "no" 

 

i have 8 dropdown fields (weekend open , close times) need examined determine whether populate yes/no. if of following 8 dropdown fields have value of time in dropdown (other default "select") - weekend care gets checked "yes"  - if none have values, "no" checked.

 

the dropdown fields named:

 

centeropensaturday

centeropensaturday2

centerclosesaturday

centerclosesaturday2

centeropensunday

centeropensunday2

centerclosesunday

centerclosesunday2

 

can javascript this?

and please let me know field place javascript in... confusing sometimes.

thanks help!

yes, kind of operation can quite tricky. think best of doing create hidden text field , use calculation event task, if field has nothing it. can use code achieve it:

 

var dropdowns = [     "centeropensaturday", "centeropensaturday2", "centerclosesaturday", "centerclosesaturday2", "centeropensunday", "centeropensunday2", "centerclosesunday", "centerclosesunday2" ];  var tickbox = false; (var in dropdowns) {     var f = this.getfield(dropdowns[i]);     if (f.valueasstring!=f.defaultvalue) {         tickbox = true; break;     } } this.getfield("weekendcare").checkthisbox(0, tickbox); 


More discussions in JavaScript


adobe

Comments

Popular posts from this blog

Reader DC

AdobeIDの作り方

Adobe InDesign CC 2017 has stopped working