- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2019 09:32 AM
Hi all,
I have written a client script, which does not allow special characters like below
var value = /^[a-zA-Z.1-9-_]+(\s+[a-zA-Z] )?$/.test(newValue);
In Service Now main UI, it is working good, like if i give space before the input of a field, it is showing alert not to enter special characters, but in service portal, that alert is not poping up. where could be the problem? Can someone help me on this?
Note: UI type is selected All
and Scope is also Global
Thanks in advance
Vijay
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 04:33 AM
Hi there,
Something like below should work. Just tested on Madrid with the Question Regular Expressions. Dfference being I escaped the "-".
^[A-Za-z0-9. \-_]*$
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2019 12:36 PM
This is the exact same regular expression used for platform view? can you post a screenshot?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 04:20 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2019 04:33 AM
Hi there,
Something like below should work. Just tested on Madrid with the Question Regular Expressions. Dfference being I escaped the "-".
^[A-Za-z0-9. \-_]*$
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2019 05:09 AM
Hi there,
Is your question solved with this? Or do we need to follow-up on this?
Please mark this answer as correct if it solves your problem. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field