How to limit the amount of characters in an inputNumber?

1

I'm using the Primefaces extension to format an input of a person's weight and height and I could not. How do I limit the amount of characters entered in input ?

I tested it with maxlength="5" but it did not work:

<pe:inputNumber 
  id="peso" 
  maxlength="5"
  label="Peso" 
  value="#{pessoaBean.pessoaCaracFisica.peso}"/>
    
asked by anonymous 24.10.2015 / 13:45

1 answer

2

Just use the maxValue attribute.

    <pe:inputNumber id="peso" maxlength="5" label="Peso" 
     maxValue="200" value="#{pessoaBean.pessoaCaracFisica.peso}"/>

In the sample code above, the largest number it will allow to be entered is 200.

    
21.09.2016 / 18:43