We really need a submitHandler
I can use you validation only if the forms are submitting normally to another window. I need to use it with ajaxSubmit instead of submit. please
I needed something like that and added a trigger for ketchup to pick up and validate.
bindFormSubmit: function(form) {
var self = this,
opt = this.options;
form.submit(function() {
return self.allFieldsValid(form, true);
});
form.bind('validateMe', function() {
return self.allFieldsValid(form, true);
});
},
I too need an ajax submit. Can you please explain your trigger. How do you actually trigger the event?
Turns out i was able to do this:
var result = $.ketchup.allFieldsValid($("#formId"), true);
result will contain either true or false to determine if everything was validated
Dear Author, without your permission, I made a change to your script, for use submitHandler. Thank you for pretty work.
For use submitHandler, please Delete :
return self.allFieldsValid(form, true);
and include: if (self.allFieldsValid(form, true)) { if (opt.customSubmit != null) { return opt.customSubmit(form); } return true; } else { return false; }
Useing example :
$('.feedback_form').ketchup({customSubmit:
function(form){
return YOURcustomSubmitFunction(); //
}});