这个VBScript怎么老是运行不了

xfga 2005-08-14 08:38:34
<html>
<head>
<title>优惠价计算</title>
</head>
<body>
<h3>优惠价计算</h3><hr>
所购商品总全额:
<input type=text name=text1 size=10>元  
<input type=button name=button1 value=计算>
<script for=button1 event=onclick language=vbscript>
x=text2.value
If Not IsNumeric(x) then msgbox("您输入的不是数值数据!"):Exit Sub
If x<1000 then y=x
ElseIf x<2000 then y=0.95*x
ElseIf x<3000 then y=0.9*x
ElseIf x<5000 then y=0.85*x
Else y=0.8*x
End If
msgbox "优惠价为:"&y&"元"
</script>
</body>
</html>
...全文
90 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sjjf 2005-08-14
  • 打赏
  • 举报
回复
<html>
<head>
<title>优惠价计算</title>
</head>
<body>
<h3>优惠价计算</h3><hr>
所购商品总全额:
<input type=text name=text1 size=10>元  
<input type=button name=button1 value=计算>
<script for=button1 event=onclick language=vbscript>
x=text1.value
If Not IsNumeric(x) then
msgbox("您输入的不是数值数据!")
exit sub
end if

If x<1000 then
y=x
ElseIf x<2000 then
y=0.95*x
ElseIf x<3000 then
y=0.9*x
ElseIf x<5000 then
y=0.85*x
Else y=0.8*x
End If
msgbox "优惠价为:"&y&"元"
</script>
</body>
</html>
边城的刀声 2005-08-14
  • 打赏
  • 举报
回复
<html>
<head>
<title>优惠价计算</title>
</head>
<body>
<h3>优惠价计算</h3><hr>
所购商品总全额:
<input type=text name=text1 size=10>元  
<input type=button name=button1 value=计算>
<script for=button1 event=onclick language=vbscript>
x=text1.value
If Not IsNumeric(x) THEN
msgbox("您输入的不是数值数据!")
else
If x<1000 then
y=x
ElseIf x<2000 then
y=0.95*x
ElseIf x<3000 then
y=0.9*x
ElseIf x<5000 then
y=0.85*x
Else y=0.8*x

end if

msgbox "优惠价为:"&y&"元"
end if
</script>
</body>
</html>
在我的电脑上已经测试通过
xfga 2005-08-14
  • 打赏
  • 举报
回复
请帮我啊,我是菜鸟

28,390

社区成员

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

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