Hello
I use the validation plugin and the following code:
submitHandler: function(form) {
$('#submit').attr("disabled", "true");
$.ajax({
type: 'POST',
url: 'submit.php',
data: $('#registerform').serialize(),
error: function() {
$('#mess').html("Failure");
$('#mess').css("display", "block");
alert('Fail!');
},
success: function(responseText) {
$('#mess').html("True");
$('#mess').css("display", "block");
alert(responseText);
}
});
}
submit.php is php script which checks the inputs for errors, but what
shall my php-script response if there is something wrong?
And can I have a "responsetext" with it? (like on success)
So the question is: who do I trigger the error function?