网页制作的高手们请进来帮忙看看。谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/19 08:07:09
下面这个表单的话怎么用了上面的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>

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

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