Archive for December, 2014

restrict an input to numbers only with PrimeFaces inputMask element

If you want or need to limit the length too, you could do something like this:

p:inputMask
mask="9?9999"
maxlength="5"
placeHolder=" "

where the user can only enter 1 to 5 digits, or the following for four digits and so on

p:inputMask
mask="9?999"
maxlength="4"
placeHolder=" "

Advertisements

, , , ,

Leave a comment