action无法传递参数

taylermail 2012-02-10 10:33:16
1.asp
.....
<form name="form1" id="form1" method="post" action="2.asp" target="save" enctype="multipart/form-data">
<table border="0" cellspacing="0" cellpadding="0" align="center" width="750" height="200">
<tr height="50">
<td align="left" style="font-size:12px;color:#00346D;" align="center">
图片描述一:<input id="id1" name="id1" type="text" />
</td>
</tr>
<tr height="50">
<td align="left" style="font-size:12px;color:#00346D;" align="center">
图片描述二:<input id="id2" name="id2" type="text" />
</td>
</tr>

<tr height="50">
<td align="left" style="font-size:12px;color:#00346D;" align="center">
图片:<input class="class1" type="file" name="mefile" size="50">图片格式为"*.jpg,文件大小小于200k"
</td>
</tr>

</table>
<input type=submit name=ok value="OK">
</form>
</BODY>
</HTML>
<script language="vbscript">
function bc_onclick()
form1.action=form1.action + "?id1=" & document.all("id1").value&id2=" & document.all("id2").value
end function
</script>

在2.asp中 无法获取id1,id2 的数值
2.asp如下:
id1=Request.QueryString("id1")
id2=Request.QueryString("id2")

response.Write id1
response.Write id2

response.End
...全文
49 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mobesen 2012-02-10
  • 打赏
  • 举报
回复
因为是用form传值的,所以在接收的时候要用request.form或者request进行接收才能接收到

id1=Request.form("id1")
id2=Request.form("id2")

试试
cup_505 2012-02-10
  • 打赏
  • 举报
回复
1、<input type=submit name=ok value="OK">,这个按钮上要加onclick事件,
2、 form1.action=form1.action + "?id1=" & document.all("id1").value&id2=" & document.all("id2").value
,在id2前少了引号,应该改成
form1.action=form1.action + "?id1=" & document.all("id1").value&"&id2=" & document.all("id2").value

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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