0

How to define an acceptable range of values (0-9999)?

if mask is defined as

.mask('9999')

acceptable values will be in range from 1000 to 9999 but I need values between 0 and 9999

dllhell
  • 1,987
  • 3
  • 34
  • 51

2 Answers2

1

After ? makes it optional:

.mask('9?999')
elclanrs
  • 92,861
  • 21
  • 134
  • 171
1

try with

.mask('9?999')

From http://digitalbush.com/projects/masked-input-plugin/

You can have part of your mask be optional. Anything listed after '?' within the mask is considered optional user input.

Fabrizio Calderan
  • 120,726
  • 26
  • 164
  • 177