You can use the success
option.
If specified, an error label is displayed to indicate the actual item. If a string is specified, it is added as a class to the label. If a function is specified, it is called with a label (as a jQuery object) and verified input (as a DOM element). The label can be used to add text like "ok!".
Example in the document: add the class "valid" to the actual elements created using CSS, and add the text "Ok!".
$("#myform").validate({ success: function(label) { label.addClass("valid").text("Ok!") }, submitHandler: function() { alert("Submitted!") } });
In your code:
$(document).ready(function(){ $("#registratieform").validate({ rules: { email: { required: true, email: true, remote: { url: "includes/check_email.php", type: "post", complete: function(data){ if( data.responseText == "false" ) { alert("Free"); } } }, }, }, messages: { email: { required: "This field is required", email: "Please enter a valid email address", remote: jQuery.format("{0} is already taken") }, }, success: function(e) {
I recommended reading the following:. validate ()
source share