ASP中一个页面多个表单如何提交
代码如下,前面是一个三级联动,三个表单,最后一个表单的数据从数据库读出,提交是如何能同时提交?<formname="myform"method="post"action=...
代码如下,前面是一个三级联动,三个表单,最后一个表单的数据从数据库读出,提交是如何能同时提交?
<form name="myform" method="post" action="saveziliao.asp">
<%
set rsa=server.CreateObject("adodb.recordset")
sq="select * from edu_c"
rsa.open sq,conn,1,1
%>
<select name="class1" onChange="changeclass2();changeclass3()">
<option value="" selected>一级</option>
<%
while not rsa.eof
%>
<option value="<%=rsa("c_name")%>"><%=rsa("c_name")
%>
</option>
<%
rsa.movenext
wend
rsa.close
%>
</select>
<select name="class2" onChange="changeclass3();changeclass4();changeclass5()">
<option value="" selected>二级</option>
</select>
<select name="class3" onChange="changeclass4();changeclass5()">
<option value="" selected>三级</option>
</select>
<%
sql="select * from edu_co"
rsa.open sql,conn,1,1
num=rsa.recordcount
str=""
for i=1 to rsa.recordcount
str=str&rsa("c_name")&"-"&rsa("co_name")&","
if rsa.eof then exit for
rsa.movenext
next
rsa.close
%>
<%
sql="select * from edu_s"
rsa.open sql,conn,1,1
num2=rsa.recordcount
str2=""
for i=1 to rsa.recordcount
str2=str2&rsa("co_name")&"-"&rsa("s_name")&","
if rsa.eof then exit for
rsa.movenext
next
rsa.close
%>
<script LANGUAGE="javascript">
arr="<%=str%>".split(",");
a=arr.length
ar=new Array()
for (i=0;i<a;i++){
ar[i]=arr[i].split("-");
}
onecount=ar.length;
arr2="<%=str2%>".split(",");
a2=arr2.length
ar2=new Array()
for (i=0;i<a2;i++){
ar2[i]=arr2[i].split("-");
}
onecount2=ar2.length;
function changeclass2() {
document.myform.class2.length=0
lid=myform.class1.value;
for (i=0;i<onecount;i++) {
if (ar[i][0] == lid) {
document.myform.class2.options.add(new Option(ar[i][1], ar[i][1]));
}
}
}
function changeclass3() {
document.myform.class3.length=0
lid2=myform.class2.value;
for (i=0;i<onecount2;i++) {
if (ar2[i][0] == lid2) {
document.myform.class3.options.add(new Option(ar2[i][1], ar2[i][1]));
}
}
}
</script>
</form>
<form name="form3" method="post" action="saveziliao.asp" >
井号: <input name="bzjinghao" type="text" id="bzjinghao" value="<%=rs("jinghao")%>" size="20">
<input name="Submit" type="submit" id="Submit" onClick="return RegForm()" value="修改">
</form> 展开
<form name="myform" method="post" action="saveziliao.asp">
<%
set rsa=server.CreateObject("adodb.recordset")
sq="select * from edu_c"
rsa.open sq,conn,1,1
%>
<select name="class1" onChange="changeclass2();changeclass3()">
<option value="" selected>一级</option>
<%
while not rsa.eof
%>
<option value="<%=rsa("c_name")%>"><%=rsa("c_name")
%>
</option>
<%
rsa.movenext
wend
rsa.close
%>
</select>
<select name="class2" onChange="changeclass3();changeclass4();changeclass5()">
<option value="" selected>二级</option>
</select>
<select name="class3" onChange="changeclass4();changeclass5()">
<option value="" selected>三级</option>
</select>
<%
sql="select * from edu_co"
rsa.open sql,conn,1,1
num=rsa.recordcount
str=""
for i=1 to rsa.recordcount
str=str&rsa("c_name")&"-"&rsa("co_name")&","
if rsa.eof then exit for
rsa.movenext
next
rsa.close
%>
<%
sql="select * from edu_s"
rsa.open sql,conn,1,1
num2=rsa.recordcount
str2=""
for i=1 to rsa.recordcount
str2=str2&rsa("co_name")&"-"&rsa("s_name")&","
if rsa.eof then exit for
rsa.movenext
next
rsa.close
%>
<script LANGUAGE="javascript">
arr="<%=str%>".split(",");
a=arr.length
ar=new Array()
for (i=0;i<a;i++){
ar[i]=arr[i].split("-");
}
onecount=ar.length;
arr2="<%=str2%>".split(",");
a2=arr2.length
ar2=new Array()
for (i=0;i<a2;i++){
ar2[i]=arr2[i].split("-");
}
onecount2=ar2.length;
function changeclass2() {
document.myform.class2.length=0
lid=myform.class1.value;
for (i=0;i<onecount;i++) {
if (ar[i][0] == lid) {
document.myform.class2.options.add(new Option(ar[i][1], ar[i][1]));
}
}
}
function changeclass3() {
document.myform.class3.length=0
lid2=myform.class2.value;
for (i=0;i<onecount2;i++) {
if (ar2[i][0] == lid2) {
document.myform.class3.options.add(new Option(ar2[i][1], ar2[i][1]));
}
}
}
</script>
</form>
<form name="form3" method="post" action="saveziliao.asp" >
井号: <input name="bzjinghao" type="text" id="bzjinghao" value="<%=rs("jinghao")%>" size="20">
<input name="Submit" type="submit" id="Submit" onClick="return RegForm()" value="修改">
</form> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询