使用jQuery在十进制后允许10位数字 [英] 10 digit allow after decimal using jquery
本文介绍了使用jQuery在十进制后允许10位数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用primeface inputText,并且只允许小数点后10位,请使用jquery提供如何执行此操作. 下面是我要应用的代码
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/>
推荐答案
尝试一下:
<h:inputText id="regReward" label="#{msg.registrationReward}"
value="#{program.regReward}">
<f:validateDoubleRange minimum="0" maximum="1000000" />
<f:convertNumber pattern="###0.##########" />
</h:inputText>
或创建Validator
并按如下方式调用它:
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>
这篇关于使用jQuery在十进制后允许10位数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文