Javascript needed - need checkbox to check automatically based on selected item from dropdown list


i building fillable form.  in form, have created items in dropdown list.  based on item picked dropdown list, need corresponding checkbox checked.  there easy javascript resolve current problem.  please assist.

 

for example: dropdown list field (subsupplier1) -   demolition                            export value 2

                                                                                rough carpentry labor       export value 4

                                                                                rough carpentry material    export value 3

 

i need corresponding checkbox (salestax1) automatically checked when demolition (export value 2) or rough carpentry material (export value 3) selected.

 

thank you,

jennifer

hi jennifer,

 

this should need. place in custom calculation property of dropbox , select "commit selected value immediately" in fields options:

 

 

var drop = this.getfield("subsupplier1");

var check = this.getfield("salestax1");

if ((drop.value == 2) || (drop.value == 3)){

check.checkthisbox(0,true);

}

else {

check.checkthisbox(0,false);

}

 

the code asking if export value of field either '2' or '3' , if so, check box.

otherwise uncheck box.

 

if don't want uncheck on other selections, remove 'else' section of code.



More discussions in JavaScript


adobe

Comments

Popular posts from this blog

Some mp4 files not displaying correctly (CS6)

Thread: Samba is not authenticating with LDAP