Skip to content

Instantly share code, notes, and snippets.

@vendettamit
Last active February 23, 2016 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vendettamit/0104d608cc4089799671 to your computer and use it in GitHub Desktop.
Save vendettamit/0104d608cc4089799671 to your computer and use it in GitHub Desktop.
Change default onfocusout and trigger validation for individual form elements while user starts typing in input fields
$(document).ready(function () {
var $validatr = $('form').data('validator');
var settngs = $validatr.settings;
settngs.onkeyup = function (element, eventType) {
if (!$validatr.element(element))
{
$(this.currentForm).triggerHandler("invalid-form", [this]);
}
};
settngs.onfocusout = false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment