- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 06:36 AM
Can anybody tell me how I set the minimum character length to 50 characters in a multi-line variable in a catalog item?
The variable itself is already mandatory but I don't want people to write just "because I want it" or other pointless answers down.
Add on: I probaply chose the wrong Location for that question, could someone tell me where to locate this question right?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 01:09 PM
Hi, you could look at onChange client script using string length to validate the field content and popup a message if minimum requirements were not met; But I don't see this as a practical configuration as it may force users to enter 'garbage' in order to be able to submit the form.
A better solution would be field message, text, tool tip, popup to clearly identify expectations
and then a clearly defined business process that deals with requests that do not have appropriate details IE process of rejecting any requests that do not meet minimal expectations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 01:09 PM
Hi, you could look at onChange client script using string length to validate the field content and popup a message if minimum requirements were not met; But I don't see this as a practical configuration as it may force users to enter 'garbage' in order to be able to submit the form.
A better solution would be field message, text, tool tip, popup to clearly identify expectations
and then a clearly defined business process that deals with requests that do not have appropriate details IE process of rejecting any requests that do not meet minimal expectations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 09:10 PM
HI @Community Alums ,
I trust you are doing fine.
You can achive this by creating onChage client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (control.id === 'YOUR_VARIABLE_NAME' && newValue.length < 50) {
g_form.addErrorMessage('Please enter at least 50 characters.');
g_form.clearValue('YOUR_VARIABLE_NAME');
}
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 10:40 PM
Hi @Tony Chatfield1,
you're right! 50 chars are way too much regarding your point. We have to decide if we lower that number or leave it totally out. We already have the tooltip pop up active, so we have to see what input we'll get.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 10:44 PM
unfortunately your script doesn't work when i copy-paste that and insert my variable. But with your answer you confirm what Tony said. So I'll have to find a way myself with the client script, but it's great learning opportunity.
All the best!