关于submit很简单的一个问题

BooBio 2005-12-09 11:39:18
就是下面的这段代码,非常简单
在input.asp中有这么一段话:
<form name='search1' method='post' action='input.asp' target='_self'>
<select name="d1_id" class="bbssel" onChange='javascript:search1.submit();'>
<option value="0" selected>无选择</option>
<%
…………
%>
</select>
</form>
当combox改变的时候就向自己提交改变,代码应该说很简单,但是就是老提交不成功,为什么呢???
那位大大帮我解答一下啊????
...全文
108 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
BooBio 2005-12-09
  • 打赏
  • 举报
回复
ok,我把全部的代码提交出来看看有没有什么问题
<!--#include file="conn.asp"-->
<%
Dim f_id
Set Rs = Server.CreateObject("ADODB.Recordset")
if not Request("d1_id")=null then f_id=Cint(Request("d1_id"))
response.write f_id
%>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<title>输入页面</title>
<LINK href="css/common2.css" type="text/css" rel="stylesheet">
</head>
<body>
<table width="70%" border="0">
<!--三维-->
<tr>
<td> </td>
<td>
<form name="d3" method="post">
<input type="hidden" name="dimension" value="2">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td colspan="2" align="right" id=bbsleft><div id="title" align="center">增加第二维数据</div></td>
</tr>
<tr>
<td width="15%" align="right"><div id="normal">名称:</div></td>
<td width="85%">
<input type="text" name="d3_name" size="25" class="bbssel">
</td>
</tr>
<tr>
<td width="15%" align="right">内容:</td>
<td width="85%">
<input type="text" name="d3_content" size="25" class="bbssel">
</td>
</tr>
<tr>
<td width="15%" align="right">一维联系:</td>
<td width="85%">
<form id='search1' name='search1' method='post' action='input.asp' target='_self'>
<select name="d1_id" class="bbssel" onChange='javascript:search1.submit();'>
<option value="0" selected>无选择</option>
<%
sqlStr = "SELECT * FROM first_dimension ORDER BY first_id"
Rs.open sqlStr,conn,1,3
DO While not Rs.eof
d1_combox_str = d1_combox_str & "<option value='" & Rs("first_id") & "'>"
d1_combox_str = d1_combox_str & Rs("first_name")
d1_combox_str = d1_combox_str & "</option>"
Rs.movenext
Loop
Rs.close
Response.write d1_combox_str
%>
</select>
</form>
</td>
</tr>
<tr>
<td width="15%" align="right">二维联系:</td>
<td width="85%">
<select name="d2_id" class="bbssel">
<option value="0" selected>无选择</option>
<%
if f_id>0 then
sqlStr = "SELECT * FROM second_dimension WHERE first_id = " & CStr(f_id) & " ORDER BY first_id,second_id"
else
sqlStr = "SELECT * FROM second_dimension ORDER BY first_id,second_id"
end if
Rs.open sqlStr,conn,1,3
DO While not Rs.eof
d2_combox_str = d2_combox_str & "<option value='" & Rs("second_id") & "'>"
d2_combox_str = d2_combox_str & Rs("second_name")
d2_combox_str = d2_combox_str & "</option>"
Rs.movenext
Loop
Rs.close
Response.write d2_combox_str
%>
</select>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="radio" name="chooseType" value="1" checked>一维基准
  
<input type="radio" name="chooseType" value="2">二维基准
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="button" name="submit" value="提交" class="bbsselb">
    
<input type="reset" name="reset" value="重置" class="bbsselb">
</td>
</tr>
</table>
</form>
</td>
<td> </td>
</tr>
</table>
</body>
</html>
sungcong 2005-12-09
  • 打赏
  • 举报
回复
请帖全码,
请检查是否有重名
harryCom 2005-12-09
  • 打赏
  • 举报
回复
<form name='search1' id='search1' method='post' action='input.asp' target='_self'>
<select name="d1_id" class="bbssel" onChange='javascript:document.getElementById("search1").submit();'>
BooBio 2005-12-09
  • 打赏
  • 举报
回复
早就尝试过了,这个方法不行啊
CnEve 2005-12-09
  • 打赏
  • 举报
回复
<form name='search1' method='post' action=''>
<select name="d1_id" class="bbssel" onChange="search1.submit();">
sungcong 2005-12-09
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<%
Dim f_id
Set Rs = Server.CreateObject("ADODB.Recordset")
if not Request("d1_id")=null then f_id=Cint(Request("d1_id"))
response.write f_id
%>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<title>输入页面</title>
<LINK href="css/common2.css" type="text/css" rel="stylesheet">
</head>
<body>
<table width="70%" border="0">
<!--三维-->
<tr>
<td> </td>
<td>
<form id='search1' name='search1' method='post' action='input.asp' target='_self'>
<input type="hidden" name="d1_id">
</form>
<form name="d3" method="post">
<input type="hidden" name="dimension" value="2">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td colspan="2" align="right" id=bbsleft><div id="title" align="center">增加第二维数据</div></td>
</tr>
<tr>
<td width="15%" align="right"><div id="normal">名称:</div></td>
<td width="85%">
<input type="text" name="d3_name" size="25" class="bbssel">
</td>
</tr>
<tr>
<td width="15%" align="right">内容:</td>
<td width="85%">
<input type="text" name="d3_content" size="25" class="bbssel">
</td>
</tr>
<tr>
<td width="15%" align="right">一维联系:</td>
<td width="85%">
<select name="d1_id" class="bbssel" onChange='search1.d1_id.value=this.value;search1.submit();'>
<option value="0" selected>无选择</option>
<%
sqlStr = "SELECT * FROM first_dimension ORDER BY first_id"
Rs.open sqlStr,conn,1,3
DO While not Rs.eof
d1_combox_str = d1_combox_str & "<option value='" & Rs("first_id") & "'>"
d1_combox_str = d1_combox_str & Rs("first_name")
d1_combox_str = d1_combox_str & "</option>"
Rs.movenext
Loop
Rs.close
Response.write d1_combox_str
%>
</select>

</td>
</tr>
<tr>
<td width="15%" align="right">二维联系:</td>
<td width="85%">
<select name="d2_id" class="bbssel">
<option value="0" selected>无选择</option>
<%
if f_id>0 then
sqlStr = "SELECT * FROM second_dimension WHERE first_id = " & CStr(f_id) & " ORDER BY first_id,second_id"
else
sqlStr = "SELECT * FROM second_dimension ORDER BY first_id,second_id"
end if
Rs.open sqlStr,conn,1,3
DO While not Rs.eof
d2_combox_str = d2_combox_str & "<option value='" & Rs("second_id") & "'>"
d2_combox_str = d2_combox_str & Rs("second_name")
d2_combox_str = d2_combox_str & "</option>"
Rs.movenext
Loop
Rs.close
Response.write d2_combox_str
%>
</select>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="radio" name="chooseType" value="1" checked>一维基准
  
<input type="radio" name="chooseType" value="2">二维基准
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="button" name="submit" value="提交" class="bbsselb">
    
<input type="reset" name="reset" value="重置" class="bbsselb">
</td>
</tr>
</table>
</form>
</td>
<td> </td>
</tr>
</table>
</body>
</html>

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧