Skip to content

Instantly share code, notes, and snippets.

@emiaj
Created January 28, 2013 01:45
Show Gist options
  • Save emiaj/4652155 to your computer and use it in GitHub Desktop.
Save emiaj/4652155 to your computer and use it in GitHub Desktop.
$.fn.activateAjaxForms = $.fn.activateAjaxForms || function () {
return this.each(function () {
var container = $(this);
$('form.validated-form', container).each(function () {
var mode = $(this).data('validationMode');
$(this).validate({
ajax: mode == 'ajax',
continuationSuccess: function (continuation) {
continuation.form.trigger('validation:success', continuation);
}
});
});
});
};
$(document).ajaxComplete(function (data) {
$(data).activateAjaxForms();
});
@jmarnold
Copy link

Thought about this one more. With the latest changes in continuations and validation, here's my recommendation:
https://gist.github.com/4670892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment