Special characters not allowed and of characters in single line text varaible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2022 08:06 AM
Hi,
I have a requirement have to allow user to fill International characters (ÀÂÉÈÊËÎÏÔÙÛÜÇàâéèêëîïôùûüç) in field along with regular characters and don't allow user to fill in numbers and special characters.
Can anyone help me how to achieve this in single line text field?
Thanks
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2022 08:11 AM
Hi,
but the characters you are showing I am not able to type those from keyboard
so how are users entering it
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2022 08:16 AM
Hello Ankur,
Thank you for your reply,
your right but some user use French key board.
some user have this kind of international characters on there name i.e. (Müller, Fernández, Martínez).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2022 08:26 AM
Hi Shekar,
You'll need to create a Regular expression for aplying that kind of control in a client script onChange. I let you some example below:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var re = /^[a-zA-Z0-9]*$/;
if (!re.test(newValue)) {
alert('not valid format');
return false;
}
return true;
}
Check also this links: https://community.servicenow.com/community?id=community_article&sys_id=ebcf2b6edbd7d0103daa1ea668961973
https://community.servicenow.com/community?id=community_question&sys_id=edbf928bdb916bc0fb115583ca961947
If it was helpful, please give positive feedback.
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆