jquery - How to clear validation errors and submit at once? -
i have form jquery validation. when enter value error, show error , adds border css.
then enter valid value , hit submit button, instead of submitting directly, first erases error message , waits me hit submit button again.
how can manage clear errors , submit @ once?
you can use example form; if need more send codes.
$(function () { $("#registerform").validate({ errorelement: "span", errorclass: "help-block", validclass: "has-success", rules: { email: { required: true, email: true, } }, messages: { email: "wrong mail!", }, highlight: function(element, errorclass, validclass) { $(element).closest(".form-group").addclass("has-error").removeclass("has-success"); }, unhighlight: function(element, errorclass, validclass) { $(element).closest(".form-group").removeclass("has-error").addclass("has-success"); } }); });
Comments
Post a Comment