<form name="testform"> <select name= "select1" onclick= "changeState(); "> <option value=1 selected="selected"> one </option> <option value=2> Two </option> </select> <input type= "text" id= "one" name= "input1" class= "input"> <input type= "text" id= "two" name= "input2" class= "input"> </form>
?
.cantinput{background-color:#aaaaaa;}
?
?
function changeState(){
if (testform.select1.value == 1) {
testform.input1.className="";
testform.input1.disabled = "";
testform.input2.className = "cantinput";
testform.input2.disabled = "true";
}
else {
testform.input1.className = "cantinput";
testform.input1.disabled = "true";
testform.input2.className = "";
testform.input2.disabled = "";
}
}
?