i am using jQuery masked input plugin.
I need to define a mask for the decimal number for percentage so that all following are valid inputs –
- 1
- 10
- 1.1
- 1.10
- 10.1
- 10.10
- 99.99
- 100
A percentage cannot be greater than 100 so 100.00 is valid but 100.01 is not.
$("#" + enum.WomenInSororitiesId).mask("9?9.99"); //valid till 99.99
With the above code, I am getting at least one number, but then for 1-9 with decimal, the user needs to input it as 01.00 or 02.00.
How can I rework this mask so that it can work for above case?
Thanks.
It is not possible to use the masked input plugin for this.
You can use a validation function to validate a percentage field with decimal places as described in a number of answers to this question:
Validating a text field containing a float is a valid percentage value?