can I disable/enable html tags using javascript?

crystal

Platinum Member
Nov 5, 1999
2,424
0
76
Let said my form have 2 Select Element:

select1 {dog, cat}

select2 {dinner, sleeping}


If the user selects: select1 = cat, I want to set select2 to disabled=true, i.e., user cannot interact with select2 any more.

If the user selects: select1 = dog, then I want to re-enable select2. Then the user can choose dinner or sleeping with select2 option.

Is this possible to do in javascript? thx.
 

oog

Golden Member
Feb 14, 2002
1,721
0
0
it is certainly possible to do. with the onchange event of select1, check the value, get a handle on select2 and set it's "enabled" property to false.