分享一个VBScript表单判断实例


网页脚本主要有两种,一种是JavaScript,一种是VBScript,两者在功能上几乎一样强大,只不过很多人习惯用JavaScript,简称JS,因为VBScript是以VB语言为基础的,ASP语言就是使用VBScript作为解释语言,下面这个简单的密码表单判断就是使用VBScript来完成的,看看有什么不同吧
<html>
<head>
<title>VBScript表单判断实例</title>
<script language=vbs>
cont=1
sub myButton_Onclick()
if mytext.value="chinaz" then location="/" else msgbox "不正确呀!正确是123":cont=cont+1
if cont>3 then msgbox"不好意思,你的密码没有输对,你暂不能查看本页。":window.close
end sub
</script>
</head>
<body>
<br>
<br>
<center>请输入密码:
<input name="myText" type="password" size=10 maxlength=8>
<input type="button" name="myButton" value="确定" >
</center>
</body>
</html>
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3