网页游戏bug发现技巧:网页制作的高手们请进来帮忙看看。谢谢

来源:百度文库 编辑:神马品牌网 时间:2024/04/29 03:24:34
下面这个表单的话怎么用了上面的javascript验证表单就是不行,不做任何验证
请高手们看看问题出在哪里,谢谢

<html>
<head>
<SCRIPT language=javascript>
function admin_add(theForm)
{
if (theForm.a_name.value=="")
{
alert("请输入用户名");
theForm.a_name.focus();
return (false);
}
if (theForm.a_pass.value.length<6)
{
alert("请输入密码或密码长度不够");
theForm.a_pass.focus();
return (false);
}
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<form method="post" onsubmit="return admin_add(this)" action="admin_message.asp">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30">管理用户名</td>
<td height="30"> <input name="a_name" type="text" id="a_name" size="15"> </td>
</tr>
<tr>
<td height="30">管理密码</td>
<td height="30"><input name="a_pass" type="password" id="a_pass" size="15"></td>
</tr>
<tr>
<td height="30">备注</td>
<td height="30"><textarea name="a_message" id="a_message"></textarea></td>
</tr>
<tr>
<td height="30" colspan="2"><input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
</table>
</form>
</body>
</html>

你的代码我完全复制下来了保存到本机上 1.html 我看了一下完全能够验证啊 用户名和密码验证都没什么问题~~~
不知道你到底是哪里遇到问题了。。

<form name="theForm" method="post" onsubmit="return admin_add(this)" action="admin_message.asp">