1 所屬部門選擇其他時 顯示一個輸入框進行填寫
#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;'/>
//js// 根據切換是否顯示其他部門輸入框 function deptChange(){ var deptid = $('#deptid').val(); // alert('type:'+hytpye); if(deptid=='other'){ $('#otherDept').show(); }else{ $('#otherDept').hide(); } }
新聞熱點
疑難解答