Take the 2-minute tour ×

I have a simple signup form with the following jQuery validation code:



    rules: {

    Username: {required: true, minlength: 6},   
    Password: {required: true, minlength: 6},
    re_Password: {required: true, equalTo: "#Password"} 



It validates correctly before I submit the form.

The problem comes when I want to also do an AJAX submit of the form, because the form no longer validates and submits without validation:

<form id="registerForm" action="register.php" method="post" onsubmit="xmlhttpPost('register.php', 'registerForm', 'signup-box'); return false;">

The default that works is:

<form method="post" id="registerForm" action="register.php">

Please, if anyone can point me in the right direction or give me some starting points to solve this I would be grateful.


Thanks to Kundan Singh Chouhan I have found the solution adding the following code to the document.ready block:





return false;

share|improve this question
The correct way to do this is with the submitHandler - it gets triggered whenever the form is submitted AND valid. The way you are doing it will do validation multiple times. –  Ryley Jul 30 '12 at 15:32

1 Answer 1

up vote 1 down vote accepted

I think you should have to remove the onsubmit event from your form tag and write the below script in document.ready()

   return false;

Hope this will fix your problem.

share|improve this answer
I have made some little modifications to your code and now works perfectly. Thank you very much. –  khalonn Jul 28 '12 at 20:16

Your Answer


