- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 09:29 PM
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
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 09:50 PM
You can find Regular expressions in "question_regex" table. You can create your own records and set the message.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 10:01 PM
Hi @avinashdubey103 ,
You can use below script i have tried in pdi its working.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var regexp = /^[1-9]\d*$/;
if (!regexp.test(newValue)) {
alert('Please enter a positive numeric value greater than 0.');
g_form.setValue('get_validation', '');
}
}
Please mark it as solution proposed and helpful if it serves your purpose.
Thanks,
Anand