为什么不支持这个属性!!!

PPLUNCLE 2003-09-12 02:51:40
<html>
<head>
<title>编写</title>
<script language="vbscript">
Sub checkdata()
<!--
if form.username.value=empty then
window.alert "用户名一定要填写哦..."
exit Sub
end if
for i=1 to len(form.username.value)
c=lcase(mid((form.username.value),i,1))
if instr("abcdefghijklmnopqrstuvwxyz0123789_",c)=0 then
window.alert "用户名输入不符合规范!"
exit sub
exit for
end if
next
if form.password.value=empty then
window.alert "密码一定要填写哦..."
exit Sub
end if
form.Submit
End Sub
-->
</script>
<body>
<form method="post" action="addmember.asp" name="form">
<table width="450" align=center bgcolor="#0066cc">
<tr align=center><td><font color="white">用户名:</font></td>
<td><input type="text" name="username" size="20"></td>
</tr>
<tr align=center><td><font color="white">密码:</font></td>
<td><input type="password" size="20" name="password"></td>
</tr>
<tr align=center><td>
<input type="button" name="submit" value="确 定" onclick="checkdata">
<input type="reset" name="reset" value="重 置">
</td></tr>
</table>
</form>
</body>
</html>


我提交的时候,就会弹出不支持此属性的警告kuai
...全文
30 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xupiao 2003-09-12
  • 打赏
  • 举报
回复
有相關的資料說數據驗證最好用javascript.

javascript的數據驗證請看www.ztjob.com的注冊頁
我就是從那學的
包括電話號碼, email地址等
xiaobird1 2003-09-12
  • 打赏
  • 举报
回复
if form.username.value="" then
msgbox "用户名一定要填写哦..."
exit Sub
end if

都这样写,试试
chinesun 2003-09-12
  • 打赏
  • 举报
回复
你把所有的empty改为len()=0比如:
if form.username.value=empty then
改为
if len(form.username)=0 then
另外,验证一般用Javascript比较好

28,390

社区成员

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

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