How to make a single line text to accept a only numbers and display custom message if string

avinashdube
Tera Guru

Hi , I have a requirement to make  a single line text to accept  only numbers and display custom message:

Quantity should be positive number and greater than 0.

I have used the regex but the it is showing this message :Not a number

 

1 ACCEPTED SOLUTION

You can find Regular expressions in "question_regex" table. You can create your own records and set the message.

Screenshot 2023-11-29 at 11.18.32 AM.png

View solution in original post

5 REPLIES 5

Anil Lande
Kilo Patron

Hi,

You can create another regex(with same expression)  and add different message as per your requirement. Use newly created Regex in your variable configuration.

 

@Anil Lande 
thanks for the reply , by creating regex you are asking to create client script or even can custom regex , please provide from where i can create it ?

You can find Regular expressions in "question_regex" table. You can create your own records and set the message.

Screenshot 2023-11-29 at 11.18.32 AM.png

shubhamdubey
Mega Sage

@avinashdube 

 

There is OOB functionality which validate the regex for the single line text variable.

For your reference i have attached the snapshot.Screenshot (44).pngScreenshot (45).png