- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 11:37 AM
If you set the character limit, you won't need an error message, it will not allow them to enter more than 15 characters. Rather than make a script (which I wouldn't recommend since they can't exceed 15 characters, and it will require RegEx), you could add an Annotation (help text) that says that it will not accept more than 15 characters if you think they need to know the character limit.
Here is screenshots of how to set up the annotations

Here is what it will look like on the form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 11:32 AM
Hi there,
You can set the max length of these fields from their dictionary settings to be 15:

If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 11:38 AM
Hi christopherperry,
Thanks for the response
It is not string type field it is a variable in catalog item for onboard form
I need to populate error if they enter more than 15 characters
Can you please help me on this script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 11:40 AM
Hi Hemanth,
Please try,
function onSubmit() {
if(g_form.getValue('field_name').length > 15){
g_form.showFieldMsg('Enter less than 15 characters ', 'error', true);
return false;
}
}
Mark Correct and Helpful if it helps.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 11:55 AM
Hi Yousaf,
Thanks for the script,
Is it possible to calculate first name field and last name field and show the error if it is more than 15 characters?
Thanks in Advance!!