Created
January 28, 2013 01:45
-
-
Save emiaj/4652155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thought about this one more. With the latest changes in continuations and validation, here's my recommendation:
https://gist.github.com/4670892