- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 11:43 PM
Hi,
I don't want to let you enter certain numbers.
Example) Allow the input of numbers other than 1-10.
Can I define a range specification in client processing?
Regards,
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 06:17 PM
so you want to allow numbers from 151? In that case you dont need regex. Regex is used to validate formats.
You can use client script for this
var x = g_form.getValue('fieldname');
if ( x >100 || x <= 150)
{
alert("Numbers cannot be between 100 and 150);
}
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 12:10 AM
you can do something like this
function onChange(control, oldValue, newValue, isLoading) {
if(isLoading || newValue == ''){
return;
}
var pattern = /^([5-9][5-9]{0,2}|1000)$/;
if(!pattern.test(newValue)){
g_form.showFieldMsg('number', 'Please enter a number between 5 to 5000', 'error');
}
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 03:50 AM
Hi,
Thank you.
What does this phrase mean? How can I write code when I don't want to let a number between "100-150" be entered?
Regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 06:17 PM
so you want to allow numbers from 151? In that case you dont need regex. Regex is used to validate formats.
You can use client script for this
var x = g_form.getValue('fieldname');
if ( x >100 || x <= 150)
{
alert("Numbers cannot be between 100 and 150);
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 06:52 PM
Hi,
Thank you.
I worked it.
Best Regards,