日期:2014-05-16 浏览次数:20743 次
function showType(str){ if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("coachType").innerHTML = xmlhttp.responseText; } } xmlhttp.open("POST", "findType.c?s="+str, true); xmlhttp.send(); showType2(str); } function showType2(str){ if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("subjectId").innerHTML = xmlhttp.responseText; } } xmlhttp.open("POST", "findType2.c?s="+str, true); xmlhttp.send(); }
<select id="coachId" name="coachId" onchange="showType(this.value),showType2(this.value)"></select> <td><div id="coachType"></div></td> <td><select id="subjectId" name="subjectId"><option>请选择教练</option></select></td>