1 Apabila memilih jabatan lain, kotak input akan dipaparkan untuk diisi


1 2 3 4 5 6 7 8 | #html
<select id= 'deptid' name= 'deptid' class = "select" onchange= 'deptChange()' >
<c:forEach var = "item" items= "${deptidList}" varStatus= "status" >
<option value= '${item.value}' > ${item.name} </option>
</c:forEach>
</select>
<!-- 类型为其他时 需要填写其它部门 -->
<input id= 'otherDept' name= 'otherDept' type= "text" class = "text" maxlength= '50' style= 'display:none;' />
|
Salin selepas log masuk
1 2 3 4 5 6 7 8 9 10 11 | function deptChange(){
var deptid = $( '#deptid' ).val();
if (deptid== 'other' ){
$( '#otherDept' ).show();
} else {
$( '#otherDept' ).hide();
}
}
|
Salin selepas log masuk