用switch解决——下拉列表变动,通达oa工作查询显示的bug。
<style></style><script> function onchanged(){
var depaterment = document.getElementById('depaterment') ;
var select_v=parseInt(depaterment.options[depaterment.selectedIndex].value);
// alert(select_v);
switch(select_v){
case 111:
document.getElementById('txt').value='111'
document.getElementById('mem').value='111部门'
break;
case 222:
document.getElementById('txt').value='222'
document.getElementById('mem').value='222部门'
break;
case 333:
document.getElementById('txt').value='333'
document.getElementById('mem').value='333部门'
break;
}
}
</script><select id="depaterment" onchange="onchanged()" name="DATA_10">
<option value="111" selected="selected">部门111</option>
<option value="222">部门222</option>
<option value="333">部门333</option>
</select> <br />
<input id="txt" readonly="readonly" name="DATA_11" type="text" /> <br />
<textarea id="mem" rows="5" cols="50" readonly="readonly" name="DATA_13"></textarea> <input onclick="onchanged()" type="button" name="DATA_12" value="查询" />