-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow hexadecimal masks #30
Comments
You can do it: |
Hi Igor, Thanks for your quick reply! That's what I'm doing at the moment and normalizing the input on the server side afterwards. It would be a great enhancement for the user experience though, if the input of the user is normalized while he types: Say, I want to see capital letters for my hex, and the user types 0a:0F, it should be normalized to "0A:0F" (or "0a:0f", if I want to see small caps) Asides from using two special mask characters like f and F there could be at least a generic alternative like having an additional option e.g.
or similar configuration. Tobi |
Hi @hoeni Example:
Hope it helps. |
Hi, that works like a charm! I wasn't aware of the keypress callback! Tobi |
No problem! Enjoy ;) |
My solution for hex color: $('.hexcolor').mask('SAAAAAA', {
'translation': {
S: {
pattern: /[#]/
},
A: {
pattern: /[A-Fa-f0-9]/
}
}
}); |
👍 |
It would be great to have a placeholder for hexadecimal input, enabling input for mac addresses for example:
FF:FF:FF:FF:FF:FF
It would be helpful to normalize this to either caps (F) or normal letters (f), depending on the placeholder.
The text was updated successfully, but these errors were encountered: