asp求救!!!

cscs112 2005-11-16 03:11:24
请问一下下面的代码怎么不能到达预想的效果,最后不能把结果返回页面,请问我哪里没搞好!


<html>
<head>
<title>男女结婚年龄建议</title>
</head>
<body>
<% sex=Request.Form("radsex")
age=cint(Request(txtage))
advice=""
if sex="男" then
if age>=40 then
advice="再不结婚就晚了!"
elseif age>=30 then
advice="可以考虑结婚了!"
elseif age>=20 then
advice="你还年轻,当以事业为重!"
elseif age<=19 and age>=1 then
advice="你太小,不应考虑结婚的事!"
else
advice="填入年龄不符合逻辑!"
end if
else

if age>=30 then
advice="再不结婚就晚了!"
elseif age>=25 then
advice="可以考虑结婚了!"
elseif age>=20 then
advice="你还年轻,当以事业为重!"
elseif age<=19 and age>=1 then
advice="你太小,不应考虑结婚的事!"
else
advice="填入年龄不符合逻辑!"
end if
end if
%>
<h1 align="center">对您结婚年龄的建议!</h1>
<form method="post" action="age.asp">
性别:<input type="radio" name="radsex" value="男" checked>男
<input type="radio" name="radsex" value="女">女<p></p>
年龄:<input type="text" name="txtage" value"=<%=age%>">
<input type="submit" value"提交资料"><br>
建议: <%=advice%>
</form>
</body>
</html>
...全文
48 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
diyager 2005-11-16
  • 打赏
  • 举报
回复
好了就快结账
diyager 2005-11-16
  • 打赏
  • 举报
回复
预想的效果是什么?
yongz_0 2005-11-16
  • 打赏
  • 举报
回复
改成如下
age=cint(Request("txtage"))

年龄:<input type="text" name="txtage" value="<%=age%>">

请记得结帖

28,406

社区成员

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

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