一个关于for each next 里参数传递的神奇的问题!

whoami0096 2005-04-15 11:39:08
请先看两段代码
'这是第一个网页 tt.asp
<form name="form1" method="post" action="ttt.asp">
<input type="radio" name="1" value="a">A <input type="radio" name="1" value="b">B
<input type="radio" name="1" value="c">C<input type="radio" name="1" value="d">D<br>
<input type="submit" value="ok">
</form>
'这是第二个网页ttt.asp
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<%
'for each name in request.form
'getname=name
'if getname="" then
'response.write"get name is kong"&"<br>"
'else
'response.write getname&"<br>"
'end if

whatget=request.form

if whatget="" then
response.write"what get is kong"&"<br>"
else
response.write whatget&"<br>"
end if


getchoice=request.form("1")

if getchoice="" then
response.write"getchoice is kong"
else
response.write getchoice
end if

'next

%>
</BODY>
</HTML>

问题是:当我在第一个网页里什么也不选,就提交时,这时我能在第二个网页里能得到参数,判断出我在第一个网页里什么也没选
但是一旦我把第二个网页的注释去掉,即放在for each next 循环里面时,当我在第一个网页里什么也不选,第二个网页就不能得到参数,也就无法判断出我在第一个网页里什么也没选了。
望达人赐教^_^
...全文
81 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lookatliu 2005-04-15
  • 打赏
  • 举报
回复
你的radiobutton是一组所以第二个页面取出来的就是你选中的直,没选就没值
lookatliu 2005-04-15
  • 打赏
  • 举报
回复
DIM VALUE
VALUE = Request.Form("1")
IF VALUE <> "" tHEN
RESPONSE.WRITE VALUE
ELSE
RESPONSE.WRITE "Empty!!"
End If

28,406

社区成员

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

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