
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 01:28 PM
Is it possible to restrict a variable's value to look like this: RQ-12345678. The user must always enter 'RQ-' and then 8 various numbers? If so, what does the script look like?
Thank you!
Solved! Go to Solution.
Labels:
- Labels:
-
Request Management
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 04:01 PM
Hi @MMT3
You can try the following code :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (!newValue.match(/^RQ-\d{8}$/)) {
alert("Invalid format. Please enter in the format RQ-12345678.");
g_form.clearValue('description')
}
//Type appropriate comment here, and begin script below
}
Thanks and Regards
Sai Venkatesh
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 04:01 PM
Hi @MMT3
You can try the following code :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (!newValue.match(/^RQ-\d{8}$/)) {
alert("Invalid format. Please enter in the format RQ-12345678.");
g_form.clearValue('description')
}
//Type appropriate comment here, and begin script below
}
Thanks and Regards
Sai Venkatesh

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2024 11:22 AM
That worked perfectly! Thank you!