How to restrict an input to a variable amount of numbers only with PrimeFaces inputMask element

后端 未结 5 2374
Happy的楠姐
Happy的楠姐 2021-02-20 05:35

I need to define something similar to this regex:

[0-9]{1, 5}

On a PrimeFaces element:



        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-20 05:56

    KeyFilter from PrimeFaces Extensions looks exactly as something you need: http://fractalsoft.net/primeext-showcase-mojarra/views/keyFilter.jsf

    According to documentation and example, it is driven by regexp, and functions exactly as it should: blocking the ability to type something not passing to the regexp.

提交回复
热议问题