This repository was archived by the owner on Dec 11, 2017. It is now read-only.
Allow specification of different placeholders for different kinds of masks.#182
Closed
jlesueur wants to merge 1 commit intodigitalBush:masterfrom
Closed
Allow specification of different placeholders for different kinds of masks.#182jlesueur wants to merge 1 commit intodigitalBush:masterfrom
jlesueur wants to merge 1 commit intodigitalBush:masterfrom
Conversation
…mask.
Allows this:
$.mask.definitions['d'] = $.mask.definitions['9'];
$.mask.definitions['m'] = $.mask.definitions['9'];
$.mask.definitions['y'] = $.mask.definitions['9'];
$.mask.placeholders['d'] = 'd';
$.mask.placeholders['m'] = 'm';
$.mask.placeholders['y'] = 'y';
$('.date-field').mask('mm/dd/yyyy');
also adds a class "placeholder" when the element is empty
Owner
|
At some point I'd like to do groups like mm where masks can define validation and control the caret and value. For instance, user types 9, I can set value to 09 and move caret to position after the 9. I'm not sure this gets me to that goal. |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allows this:
Or placeholders can be specified using the options parameter.
also adds a class "placeholder" when the element is empty.
There's some whitespace changes that I can remove if it bothers you, and there may be better things to do than add a placeholder class when empty (such as trigger("mask:empty")). But I think the placeholder implementation is solid. I can also split the changes up if you prefer.