percentage, can't enter 100% #92

Closed
ludo-h opened this Issue Jul 4, 2012 · 3 comments

4 participants

@ludo-h

As an example you've show the 99% option,

$("#pct").mask("99%");

but is it possible to enter 100%, without allowing to enter 999%

@FagnerMartinsBrack

No it is not.
You may create a separate event to handle the proper calculations.

@mckramer

I ran into this case as well, but eventually decided not to use masking in this situation.

However, you can mask in this situation by allowing to left pad with 0's:

$.mask.definitions['#']='[0-1]';
$("#percent").mask("#99%");

Here is quick jsfiddle with the example in action.

@digitalBush
Owner

Right now we're limited to fixed width masking. @FagnerMartinsBrack suggestion of adding validation is the route is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment