问题
I am using primeface inputText and want to allow only 10 digit after decimal, plz provide how to do this using jquery. below is my code where I want to apply
<p:inputText id=inputId/>
回答1:
Try this:
<h:inputText id="regReward" label="#{msg.registrationReward}"
value="#{program.regReward}">
<f:validateDoubleRange minimum="0" maximum="1000000" />
<f:convertNumber pattern="###0.##########" />
</h:inputText>
or create Validator and call it like this:
<h:inputText id="regReward" label="#{msg.registrationReward}"
value="#{program.regReward}">
<f:validateDoubleRange minimum="0" maximum="1000000" />
<f:validator validatorId="dec-points-validator" />
<f:attribute name="decimalAllowed" value="#{referenceData.amountDecPlace}" />
<f:convertNumber pattern="###0.######" />
</h:inputText>
来源:https://stackoverflow.com/questions/21981851/10-digit-allow-after-decimal-using-jquery