<!doctype html>
<meta charset= "UTF-8" >
<title>Document</title>
<script language= "Javascript" >
function Hide () {
var mode = document.getElementById ("mode");
var hykhlk = document.getElementById ("Hykh_lk");
if (mode.value! = 1)
{
Hykhlk.setattribute ("ReadOnly", true);
Hykhlk.style.backgroundcolor= "#d2d2d2";
}
Else
{
Hykhlk.removeattribute ("readOnly");
Hykhlk.style.backgroundcolor= "#ffffff";
}
}
</script>
<body>
<select name= "mode" id= "mode" class= "Dept_select" style= "width:100px;" onclick= "Hide ()" >
<option value= "1" #if ($resultMap. mode==1) selected#end> off-site vehicles </option>
<option value= "2" #if ($resultMap. mode==2) selected#end> entry vehicle </option>
<option value= "3" #if ($resultMap. mode==3) selected#end> stranded vehicles </option>
</select>
<input type= "text" name= "Hykh_lk" id= "Hykh_lk" value= "124" style= "width:100px;" class= "text"/>
</body>
Three ways to control input inputs (one JS implementation)