Created
April 23, 2011 23:34
-
-
Save baileylo/939084 to your computer and use it in GitHub Desktop.
Simple check api wrapper for jquery
This file contains hidden or 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
(function( $ ){ | |
$.fn.checkValidity = function() { | |
var html_object = this.get.(0); | |
if (typeof html_object.checkValidity != 'function') { | |
switch(this.attr('type')) { | |
case 'email': | |
// add email validation | |
break; | |
case 'url': | |
// Add url validation | |
break; | |
} | |
return true; | |
} else { | |
return html_object.checkValidity(); | |
} | |
}; | |
})( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment