Skip to content

Instantly share code, notes, and snippets.

@igortoliveira
Created January 5, 2015 21:46
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 igortoliveira/86eae76d4dd36f8c1e8c to your computer and use it in GitHub Desktop.
Save igortoliveira/86eae76d4dd36f8c1e8c to your computer and use it in GitHub Desktop.
var validator = $.data( this[ 0 ], "validator" );
if ( validator ) {
return validator;
}
// Add novalidate tag if HTML5.
this.attr( "novalidate", "novalidate" );
validator = new $.validator( options, this[ 0 ] );
$.data( this[ 0 ], "validator", validator );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment