Created
July 21, 2017 15:31
-
-
Save emmanuelbarturen/612256f2f9b7091b9cb0bd9b5c5008df to your computer and use it in GitHub Desktop.
simulate native maxlenth validation for mozilla
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
$('input[maxlength]').on('keyup',function(){ | |
var max = $(this).attr('maxlength'); | |
var currentLength = $(this).val().length; | |
return max <= currentLength; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment