if ( $("#form").validate().form() == true ) {
$('#form').submit( function() {
var mail = $("#mail_content").val();
$.ajax({
type: "POST",
url: "process.php",
data: "mail="+ mail,
success: function(){
$('.email').fadeOut(200);
$('.notified').delay(200).fadeIn(200);
}
});
return false;
});
}
else {}
i think the
if ( $("#form").validate().form() == true ) {
is not what is has to be
my resource:
http://docs.jquery.com/Plugins/Validation/Validator/form
the submit ajax part is working, i only want to validate the inputted emailadress
merci for your help
EDIT:
i forgot
i have tried this code
$("#form").validate({
submitHandler: function(form) {
$('#form').submit( function() {
var mail = $("#mail_content").val();
$.ajax({
type: "POST",
url: "process.php",
data: "mail="+ mail,
success: function(){
$('.email').fadeOut(200);
$('.notified').delay(200).fadeIn(200);
}
});
return false;
});
}
});
but for some reason i have to click the submit button twice…??
see what i mean here:
The second code example in your question is almost correct, except for the common mistake of reusing the jQuery object of your form. In this case you do not need to trigger the
submitevent again because you’re using an AJAX request to handle the process.Read the following section of the plugin documentation: Too much recursion
The correct syntax would be: