10 digit allow after decimal using jquery

…衆ロ難τιáo~ 提交于 2019-12-12 04:14:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!