日期:2014-05-19 浏览次数:20807 次
<script language="javascript"> var xmlHttpRes; function createXMLHttpRequest() { if(window.XMLHttpRequest) { xmlHttpRes = new XMLHttpRequest(); } else if(window.ActiveXObject) { xmlHttpRes = new ActiveXobject("Microsoft.XMLHTTP"); } } function selectchange() { createXMLHttpRequest(); var department = document.getElementById("department").value; var url = "selectChangeServlet?department=" + department; xmlHttpRes.open("post", url, true); xmlHttpRes.onreadystatechange = callback; xmlHttpRes.send(null); } function callback() { if(xmlHttpRes.readyState == 4) { if(xmlHttpRes.status == 200) { eval(xmlHttpRes.responseText); } } } function show(){ var department = document.getElementById("department").value; var classInfo = document.getElementById("classInfo").value; alert("您确定是上【" + department + classInfo + "】的课吗?") ; } </script>
------解决方案--------------------
jsp中:
<tr> <td>区域 </td> <td> <select style="width: 155px" id="selectArea" name="issueTracking.areaCode" onchange="whenAreaChange();"></select> <s:textfield name="issueTracking.areaName" id="textAreaName" readonly="true" /> </td> </tr> <tr> <td>製程</td> <td> <select style="width: 155px" id="selectProcess" name="issueTracking.process"></select> <s:textfield name="issueTracking.processName" id="textProcess" readonly="true" /> </td> </tr>