sLimit special characters and spaces
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 07:09 AM
Hi Team,
Suppose I have a single line text field on a ritm. How to limit special characters and spaces input on that so that it accepts only numbers and alphabets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 07:17 AM
Is that a variable where you want validation during catalog form submission?
if yes then please use variable validation regex where no script is required
Out of the box there is already 1 for numbers and alphabets
Simply associate this to your variable under type specifications
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 08:30 AM - edited 04-19-2024 09:00 AM
Hi Ankur,
Thanks, but this doesn't prevent spaces from being entered in the field, can you kindly help with how I can prevent spaces(at the start, in between or in the end) as well maybe by modifying the validation regex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 09:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 03:01 AM
Hi Amit,
It says that its not a valid regular expression upon trying to save