- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-14-2022 09:29 PM
Hi All,
I have a short description field type list which consists of 20 choices/ values
I should allow/restrict users to enter/select any 5 value/choices in short description field
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-15-2022 12:06 AM
Hi,
something like this in onChange of that field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if (newValue.toString().split(',').length > 5) {
alert('Please select only 5 values');
}
}
OR
you can also use onSubmit
function onSubmit(){
if (g_form.getValue('fieldName').toString().split(',').length > 5) {
alert('Please select only 5 values');
return false;
}
}
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-14-2022 09:51 PM
Hi,
Please delete this duplicate question
You already asked it 2hrs ago and I responded to it
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-14-2022 10:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-15-2022 12:06 AM
Hi,
something like this in onChange of that field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if (newValue.toString().split(',').length > 5) {
alert('Please select only 5 values');
}
}
OR
you can also use onSubmit
function onSubmit(){
if (g_form.getValue('fieldName').toString().split(',').length > 5) {
alert('Please select only 5 values');
return false;
}
}
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-15-2022 01:56 AM