1$("#signup").validate( {
2 rules: {
3 username: {
4 required: true,
5 minlength: 5,
6 remote: {
7 url: "dbquery.php",
8 type: "get",
9 data: {
10 action: function () {
11 return "checkusername";
12 },
13 username: function() {
14 var username = $("#username").val();
15 return username;
16 }
17 }
18 }
19 }
20 },
21 messages: {
22 username: {
23 required: "Enter a username"
24 }
25 },
26 submitHandler: function(form) {
27 form.submit();
28 }
29});