那有没有用asp vbscript代码来进行表单的检查呢?
我看到的一些多是用javascript来写的
[此贴子已经被作者于2005-10-26 13:54:10编辑过]
[CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> New Document </title>
<script language="vbscript"> sub checkform()
if trim(form1.username.value)="" then msgbox("用户名不能为空") form1.username.focus() window.event.returnValue=false return end if if trim(form1.password.value)="" then msgbox("密码不能为空") form1.password.focus() window.event.returnValue=false return end if if form1.password.value<>form1.repwd.value then msgbox("2次输入密码不对") form1.repwd.focus() window.event.returnValue=false return end if if IsNumeric(form1.qq.value)=false then msgbox("QQ要输入数字") form1.qq.focus() window.event.returnValue=false return end if end sub </script> </head>
<body> <form action="index.asp" method="post" onsubmit="checkform()" name="form1"> <input type="text" name="username"><br> <input type="password" name="password"><br> <input type="text" name="repwd"><br> <input type="text" name="qq"> <input type="submit"> </form> </body> </html> [/CODE]