- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-21-2022 11:24 AM
Hi,
I need to restrict the first name and last name fields more than 15 letters
Can you help me on script?
Thanks in Advance!!
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-21-2022 01:28 PM
Can you please try
g_form.addErrorMessage Instead of showErrorBox.
***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:31 AM
Heres is a link to a solution to your problem. It mentions using the variable attribute to limit the characters, such as, max_length=15
If this solved your issue, please mark this correct and helpful, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-21-2022 11:36 AM
Hi Zack,
Thanks for the response
I need to populate error if they enter more than 15 characters
Can you please help me on this ?
Thanks in Advance!!

- 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