I'm trying to use the jQuery validation plugin and then submit my form via ajax, but I'm missing something. Anybody have any insight?
$('#theForm').validate({
focusInvalid: false,
invalidHandler: function () {
$('#message').addClass('error').html('Please fill out all necessary fields.').slideDown();
},
submitHandler: function (form) {
$('#message').removeClass('error').html('Saving info.').slideDown();
$.post(form.action, $(form).serialize(), function () {
$('#message').removeClass('error').html('Saving complete.').slideUp(3500);
});
}
});