Clarity Service Management

Expand all | Collapse all

how to make text field input only numeric value

Jump to Best Answer
  • 1.  how to make text field input only numeric value

    Posted 03-13-2018 12:21 PM

    Hi Team , 

     

    I am new to catalog , was trying to make text filed which only accept Numeric value as input.



  • 2.  Re: how to make text field input only numeric value
    Best Answer

    Posted 03-13-2018 01:07 PM

    Hi, you can use regular expressions for pattern matching and highlight the field red when it doesn't match the pattern.  Input ^\d+$ into the pattern field and add a pattern message.  That should do the trick.  I use Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript  to build/test  regex.



  • 3.  Re: how to make text field input only numeric value

    Posted 03-13-2018 01:22 PM

    thanks a lot that worked just fine. one more question should i add the text field values and display them in the other text field.



  • 4.  Re: how to make text field input only numeric value

    Posted 03-14-2018 08:35 AM

    Hope that will help others as well.

    "setValue: function() {
    var currentValue = ca_fdGetTextFieldValue(ca_fd.formId,'txtf_8');
    currentValue=currentValue*48;
    ca_fdSetTextFieldValue(ca_fd.formId, 'txtf_9', currentValue); "