ASP 复选框 提交表单
帮我查查,以下代码到底错在哪里?<html><head><title>ASP</title></head><body><fontsize="+1"face="TimeNe...
帮我查查,以下代码到底错在哪里?
<html>
<head>
<title>ASP</title>
</head>
<body>
<font size="+1" face="Time New Roman">
<form name="form1" method="get" action="">
Choose the elegment you want to order:</font><hr width="250" align="left">
CPU<Input type="checkbox" name="things" value="1">
MainBoard<input type="checkbox" name="things" value="2">
Hard Disk<Input type="checkbox" name="things" value="3"><br>
DRAM<Input type="checkbox" name="things" value="4">
AGP Board<Input type="checkbox" name="things" value="5">
<input type="submit" name="submit" value="Order!">
<hr align="left" width="250">
</form>
<%
if request.form("things")<> 1 or 2 or 3 or 4 or 5 then
response.write("You ordered nothing")
else
response.write("The thing(s) you ordered are/is ")
if request.form("things")=1 then
response.write("CPU" & "<br>")
end if
if request.form("things")=2 then
response.write("MainBoard" & "<br>")
end if
if request.form("things")=3 then
response.write("Hard Disk" & "<br>")
end if
if request.form("things")=4 then
response.write("DRAM" & "<br>")
end if
if request.form("things")=5 then
response.write("AGP Board" & "<br>")
end if
end if
%>
</font>
</body>
</html>
<html>前添加<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> 展开
<html>
<head>
<title>ASP</title>
</head>
<body>
<font size="+1" face="Time New Roman">
<form name="form1" method="get" action="">
Choose the elegment you want to order:</font><hr width="250" align="left">
CPU<Input type="checkbox" name="things" value="1">
MainBoard<input type="checkbox" name="things" value="2">
Hard Disk<Input type="checkbox" name="things" value="3"><br>
DRAM<Input type="checkbox" name="things" value="4">
AGP Board<Input type="checkbox" name="things" value="5">
<input type="submit" name="submit" value="Order!">
<hr align="left" width="250">
</form>
<%
if request.form("things")<> 1 or 2 or 3 or 4 or 5 then
response.write("You ordered nothing")
else
response.write("The thing(s) you ordered are/is ")
if request.form("things")=1 then
response.write("CPU" & "<br>")
end if
if request.form("things")=2 then
response.write("MainBoard" & "<br>")
end if
if request.form("things")=3 then
response.write("Hard Disk" & "<br>")
end if
if request.form("things")=4 then
response.write("DRAM" & "<br>")
end if
if request.form("things")=5 then
response.write("AGP Board" & "<br>")
end if
end if
%>
</font>
</body>
</html>
<html>前添加<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> 展开
3个回答
展开全部
<%
dim things,tmp
things=request("things")
tmp="The thing(s) you ordered are/is <br>"
select case things
case 1
response.write(tmp&"CPU<br>")
case 2
response.write(tmp&"MainBoard<br>")
case 3
response.write(tmp&"Hard Disk<br>")
case 4
response.write(tmp&"DRAM<br>")
case 5
response.write(tmp&"AGP Board<br>")
case else
response.write("You ordered nothing")
end select
%>
dim things,tmp
things=request("things")
tmp="The thing(s) you ordered are/is <br>"
select case things
case 1
response.write(tmp&"CPU<br>")
case 2
response.write(tmp&"MainBoard<br>")
case 3
response.write(tmp&"Hard Disk<br>")
case 4
response.write(tmp&"DRAM<br>")
case 5
response.write(tmp&"AGP Board<br>")
case else
response.write("You ordered nothing")
end select
%>
展开全部
我咋不知道if request.form("things")<> 1 or 2 or 3 or 4 or 5 then 这个还能这么写呀? 如果条件比较多,用SELECT CASE最好不过了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
随意漂浮 是正解。
判断这个是不是空,只要与空字符比较一下就知道了。。。
判断这个是不是空,只要与空字符比较一下就知道了。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询