新手求助~帮帮忙啊~关于select下拉框级联的问题。
<script>
function _submit() {
if (countSd()) {
document.f.submit();
}
}
function countSd () {
var rs = <c:out value='${rs}'/>;
var bhs = document.getElementsByName("bh");
var total = bhs.length;
for (var i=0; i < total-1; i++) {
var temp = bhs[i].value;
if (temp=="") {
continue;
}
var tempTotal = 1;
for (var j=i+1; j < total; j++) {
if (bhs[j].value == temp) {
tempTotal++;
if (tempTotal > rs) {
alert(bhs[j][bhs[j].selectedIndex].text+"班的人数超过了规定的班级人数上限"+rs+",请重新调整人数分配!");
return false;
}
}
}
}
return true;
}
function ChkAllClick(sonName, cbAllId){
var arrSon = document.getElementsByName(sonName);
var cbAll = document.getElementById(cbAllId);
var tempState=cbAll.checked;
for(i=0;i<arrSon.length;i++) {
if(arrSon[i].checked!=tempState)
arrSon[i].click();
}
}
function query() {
location.href='<%=request.getContextPath()%>/application/xj/StdGraduate/query_stu_graduate2.jsp';
}
function change(){
var dll= document.getElementById('s1');
var index = dll.selectedIndex;
var Text = dll.options[index].text;
dll.length = 0 ;
dll.options[dll.length] = new Option(Text);
}
</script>
</head>
<body align="center">
<form name="f" method="post" target="_self" action="<c:url value='/xj/classSetting.do?method=distributeClass'/>">
<%@include file="/common/include/message.jsp"%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" height="30">
<c:set var="existClass" value="0"/>
<c:forEach items="${gyClasslistList}" var="item" varStatus="index">
<c:set var="existClass" value="1"/>
<c:if test='${index.count==1}'> 其中:</c:if>
【<c:out value='${item.bjbm}'/>:<c:out value='${item.bjrs}'/>人】
</c:forEach>
</td>
</tr>
<tr>
<td colspan="2" height="30">
分班时请注意,每班规定人数上限为【<c:out value='${rs}'/>】人!
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tab_1" id="reg易做图table">
<div align="right" style="background-color:#E9F6FF;">
<input type="button" style="width:50px;" id="exportbtn" name="exportbtn" value="查询" class="inputbutton" onclick="query()">
</div>
<tr class="tab_0">
<td height="25" align="center" width="4%"><input type="checkbox" name="chkAll" id="chkAll" onClick="ChkAllClick('chkSon','chkAll')" ></td>
<td height="25" align="center" width="6%">序号</td>
<td height="25" align="center" width="15%">班级</td>
<td height="25" align="center" width="10%">学号</td>
<td height="25" align="center" width="15%">姓名</td>
<td height="25" align="center" width="10%">性别</td>
<td height="25" align="center" width="15%">专业</td>
</tr>
<c:set var="total" value="0"/>
<c:set var="previousBh" value="-1"/>
<c:forEach items="${gyXjStudentList}" var="item" varStatus="index">
<c:if test="${previousBh eq '-1'}">
<c:set var="previousBh" value="${item.bh}"/>
</c:if>
<c:if test="${item.bh ne previousBh}">
<tr class="tab_1">
<td colspan="8"> </td>
<c:set var="previousBh" value="${item.bh}"/>
</tr>
</c:if>
<c:set var="total" value="${total+1}"/>
<c:if test="${index.count % 2 ==0}">
<tr class="tab_3">
</c:if>
<c:if test="${index.count % 2 !=0}">
<tr class="tab_5">
</c:if>
<td align="center"><input name="chkSon" id="chkSon" type="checkbox"> </td>
<td align="center"><c:out value="${index.count}"/></td>
<td align="center"><input type="hidden" name="studentId" value="<c:out value='${item.id}'/>">
<select name="s1" id="s1" style="width=159;" onChange="change()">
<option value="">------------</option>
<c:forEach items="${gyClasslistList}" var="subitem" varStatus="index">
<option value="<c:out value='${subitem.bh}'/>"
<c:if test="${subitem.bh eq item.bh}">selected</c:if>>
<c:out value='${subitem.bjbm}'/>
</option>
</c:forEach>
</select></td>
<td align="center"><c:out value="${item.xh}"/></td>
<td align="center"><c:out value="${item.xm}"/></td>
<td align="center"><c:out value="${item.xb}"/></td>
<td align="center"><c:out value="${item.zy}"/></td>
</c:forEach>
<c:if test="${existClass==1}">
<tr class="tab_title_bottom">
<td align="center" colspan="8">
<input name="submitbutton" type="button" class="inputbutton" value="提 交" onclick="return _submit();">
<input name="cancelbutton" type="reset" class="inputbutton" value="重 置">
</td>
</tr>
</c:if>
</table>
</form>
</body>
</html>
要实现的功能是 前面的Check复选框被选中的情况下 可以用下拉框进行批量操作 这个应该怎样实现啊 因为这个问题 纠结了一天了 救命啊 --------------------编程问答-------------------- 你这个贴不好回答 没有明白意思 用下拉框进行批量操作 是要做什么? 不知道你是不会那个地方 --------------------编程问答-------------------- 贴关键点加说明!
补充:Java , Web 开发