这段JS怎么不执行啊?
function valication(){
var username = $("#username").val();
var password = $("#password").val();
var repassword = $("#repassword").val();
if (username=="")
{
alert("用户名不能为空");
return false;
}
else if(password=="")
{
alert("密码不能为空");
return false;
}
else if(repassword=="")
{
alert("请再次输入一次密码");
return false;
}
else if(username.length<4||username.length>16)
{
alert("用户名应为4-16个字符");
return false;
}
else if(password.length<6||password.length>16)
{
alert("密码应为6-16个字符");
return false;
}
else if (repassword!=password)
{
alert("两次密码输入不一致!");
return false;
}
else {
return true;
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<SCRIPT type="text/javascript" src="${base}/res/common/js/jquery.js"></SCRIPT>
<script src="${base}/res/admin/js/oybmember.js" type=text/javascript></script>
<link href="${base}/res/admin/css/oybmember.css" type="text/css" rel=stylesheet>
<title>添加用户</title>
</head>
<body>
<h2 align="center">添加用户</h2>
<div style="width:310px; height:220px; margin:300px auto; border:solid 2px blue">
<form name="add" action="${base}${appBase}/admin/addmember.do" method="post" onsubmit="javascript:return valication();">
<table>
<tr><td class="tdname">用户名:</td><td><input type="text" required="true" id="username" name="username" style="width: 200px;" maxlength="16" /></td><td class="important">*</td></tr>
<tr><td class="tdname">密码:</td><td><input type="password" id="password" name="password" style="width: 200px;" maxlength="16" /></td><td class="important">*</td></tr>
<tr><td class="tdname">确认密码:</td><td><input type="password" id="repassword" name="repassword" style="width: 200px;" maxlength="16" /></td><td class="important">*</td></tr>
<tr><td class="tdname">E-mail:</td><td><input type="text" id="email" name="email" style="width: 200px;" maxlength="50" /></td><td></td></tr>
<tr><td class="tdname">姓:</td><td><input type="text" id="firstName" name="firstName" style="width: 200px;" maxlength="16" /></td><td></td></tr>
<tr><td class="tdname">名:</td><td><input type="text" id="lastName" name="lastName" style="width: 200px;" maxlength="16" /></td><td></td></tr>
<tr>
<td><input typ