Restrict Special Characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2020 06:59 AM
Hi
I want to restrict special character / \during creation of use id in user form.
Please help if you have any idea.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2020 07:19 AM
Hello,
You can create onchange client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var specialChar = /[~@|$&^<>\*+=;?`'())[\]]/;
if(specialChar.test(newValue)){
alert('special characters not allowed');
g_form.setValue('Field','');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2020 07:22 AM
But i want to use those 2 special characters only.
how i can use those 2 characters?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2020 07:32 AM
Hi, you mention that "restrict special character / \during creation of use id in user form.".
which special character is allowed in your case, including a-z,A-Z and 0-9.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2020 07:34 AM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var specialChar = /\;
if(specialChar.test(newValue)){
alert('special characters not allowed');
g_form.setValue('Field','');
}
}