一个简单的用户注册脚本验证(VBScript)


 <Script Language="Vbscript">
  Function CheckUserName()
   Alert "1"
  End Function

  Function CheckInput()
  If Len(Trim(thisform.username.value)) < 3 Then
   Alert "用户名不能小于三个字符"
   thisform.username.focus()
  ElseIf Len(Trim(thisform.username.value)) > 12 Then
   Alert "用户名不能大于十二个字符"
   thisform.username.focus()
  ElseIf Len(Trim(thisform.password1.value)) < 6 Then
   Alert "密码不能小于6个字符"
   thisform.password1.focus()
  ElseIf Len(Trim(thisform.password2.value)) < 6 Then
   Alert "密码不能小于6个字符"
   thisform.password2.focus()
  ElseIf Trim(thisform.password2.value) <> Trim(thisform.password2.value) Then
   Alert "两次输入的密码不一致,请检查"
   thisform.password1.focus()
  ElseIf thisform.Question.value="" then
   Alert "请设置您的密码保护问题,在您遗忘密码时可以通过回答此问题找回密码"
   thisform.question.focus()
  ElseIf Len(Trim(thisform.pwdAnswer.Value)) < 1 then
   Alert "请填写您的密码提示答案,在您找回密码时能过提供它来找回密码"
   thisform.pwdAnswer.focus()
  ElseIf thisform.userType(0).checked = False and thisform.userType(1).checked = False then
   Alert "请选择您要注册的会员类型:教师或学生,二者的可用功能将是有区别的"
  ElseIf len(trim(thisform.email.value)) < 1 then
   Alert "请输入邮箱地址"
   thisform.email.focus()
  ElseIf Instr(thisform.email.value,"@") = 0 then
   Alert " 错误的邮箱格式"
   thisform.email.focus()
  else
   thisform.submit()
  End If
  End Function
 </Script>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值