Lwc Field input validation 0-60 number only Pattern - regular expression in js



  pattern="^([0-5]?[0-9]|60)$" - we need to give in <input 

Ex : Lwc Field input validation 0-60 number only Pattern


<lightning-input type="text" label="Release Timer In Minutes"  onchange={timerChange} value={timer}

        message-when-pattern-mismatch="You Should Enter 0 - 60" pattern="^(0|[1-9]\d*)$"></lightning-input>


ex :  Lwc Field input validation 0 < any number


<lightning-input type="text" label="Release Timer In Minutes"  onchange={timerChange} value={timer}

        message-when-pattern-mismatch="You Should Enter 0 Or Higher Value - Negetive Values Not Allowed" pattern="^(0|[1-9]\d*)$"></lightning-input>

Comments

Popular posts from this blog

Multi currency in Salesforce - Revenue Cloud Advance - Revenue Lifecycle Management

How to get sessionid and salesforce org base url in salesforce

rollup summary with bulk record handling without hitting governer limits