Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
123
rated 0 times [  124] [ 1]  / answers: 1 / hits: 45855  / 10 Years ago, tue, december 23, 2014, 12:00:00

I want to implement simple jquery mask pluging using jquery input.mask plugin, however, i cannot make it work with regex. What i want to achieve is:



99:59:59


Fiddle


More From » jquery

 Answers
12

You can do it like this.



$(#test).inputmask({
mask: 99:59:59,
definitions: {'5': {validator: [0-5]}}
});


The validator is an expression. Telling the 5 in the mask string to contain only numerical characters from 0 to 5.



edit: changed '-' to ':'


[#68413] Friday, December 19, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
blair

Total Points: 384
Total Questions: 108
Total Answers: 86

Location: Northern Ireland
Member since Tue, May 5, 2020
4 Years ago
;