大家帮我看看下面这个ASP程序有啥问题啊?每次打开跳过了前面的输入身高弹框,直接弹出最后不需要买票弹框
<html>
<head>
<title>买票</title>
</head>
<body>
<script language="vbscript" type="text/vbscript">
height=inputbox("请输入身高:(单位cm)")
if height>=160 then
msgbox("您需要买全票")
elseif height>=140 and height<160 then
msgbox("您只需要买半票")
else
msgbox("您不需要买票哦,希望你快点长高!")
end if
</script>
</body>
</html>
补充:我是WIN7 32位的系统啊,装了IE9还是不行!为什么在XP系统上能正常运行?
追问:最好输入用弹框,不用表单~
答案:代码改成如下可以实现你要的功能:
<html>
<head>
<title>买票</title>
<script language="vbscript">
<!--
sub chex(num1)
dim he
he=cint(num1)
if he>=160 then
msgbox "您需要买全票"
else if (he>=140 and he<160) then
MsgBox "您只需要买半票"
else
msgbox "您不需要买票哦,希望你快点长高!"
end if
end if
end sub
-->
</script>
</head>
<body>
<form name="form1">
请输入身高:(单位cm)<input name="hei" type="text"></input>
<input type="submit" value="提交" onclick="chex form1.hei.value">
</form>
</body>
</html>
其他:我用IE8测试正常。
上一个:如何在本机上浏览asp文件,(除了装iis)本人机子老出问题,iis老停止运行
下一个:ASP+ACCESS查询代码(在线等)