<%@ page contentType="text/html; charset=UTF-8" language="java"%> <%@ page import = "java.sql.*"%> <%@ page import = "java.util.*"%> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <html> <head> <title>jQuery表单验证--验证两个字段</title> <script type="text/javascript" src="<c:url value='/script/jquery-1.4.2.min.js'/>"></script> <script type="text/javascript" src="<c:url value='/script/formValidator-4.0.1.js'/>"></script> <script type="text/javascript" src="<c:url value='/script/jquery.metadata.js'/>"></script> <script type="text/javascript" src="<c:url value='/script/messages_cn.js'/>"></script> <script type="text/javascript"> $(document).ready(function() { $("#signupForm").validate(); }); </script> </head> <body>
<form method="get" action=""> <table> <tr> <td><label for="firstname">Firstname</label></td> <td><input name="firstname" /></td> </tr> <tr> <td><label for="email">E-Mail</label></td> <td><input name="email" /></td> </tr> <tr> <td><label for="password">Password</label></td> <td><input name="password" type="password" /></td> </tr> <tr> <td><label for="confirm_password">确认密码</label></td> <td><input name="confirm_password" type="password" /></td> </tr> <tr> <td></td> <td><input type="submit" value="Submit"/></td> </tr> </table> </form> </body> </html>