Created
October 15, 2013 14:35
-
-
Save joice/6992533 to your computer and use it in GitHub Desktop.
js mask
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
options = onKeyPress: (phone) -> | |
console.log phone | |
console.log phone.length | |
console.log this | |
masks = ["(00) 0000-0000", "(00) 00000-0000"] | |
mask = (if (phone.length > 14) then masks[1] else masks[0]) | |
$(".phone-input").mask mask, this | |
$(".phone-input").mask "(00) 00000-0000", options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment