How to clear Jquery validation error messages ?

Posted by Yashwant Chavan on Stack Overflow See other posts from Stack Overflow or by Yashwant Chavan
Published on 2010-01-18T13:29:58Z Indexed on 2010/04/22 7:23 UTC
Read the original article Hit count: 385

Filed under:

Hi, I am using jquery validation plugin for client side validation.

but i want to clear error mesages on my form clear button

editUser() is called on click of Edit User button.

clear button having separated function clearUser(){
// Need to clear previous errors here
}


function editUser(){    
    var validator = $("#editUserForm").validate({
            rules: {                            
                userName: "required"
        }, 
        errorElement: "span" ,               
        messages: {
          userName: errorMessages.E2
        }
      });

     if(validator.form()){ 
        // form submition code

    }
}

Thanks

© Stack Overflow or respective owner

Related posts about jQuery