jQuery ajax form submit - multiple post/get requests caused when validation fails
Hi, I have a problem where if a form submission (set up to submit via AJAX) fails validation, the next time the form is submitted, it doubles the number of post requests - which is definitely not what I want to happen. I'm using the jQuery ValidationEngine plugin to submit forms and bind validation messages to my fields. This is my code below. I think my problem is that I need to unbind from the validationEngine plugin when the form fails, but I can't figure out how to do this. Any ideas?
-
$('input#eligibility').live("click", function(){
$(".form_container form").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: $('.form_container form').attr('action'),
success : function() {
var url = $('input.next').attr('rel');
ajaxFormStage(url);
},
failure : function() {
//unique stuff for this form
}
});
});