Special characters not allowed and of characters in single line text varaible

shekhar3
Tera Contributor

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 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

but the characters you are showing I am not able to type those from keyboard

so how are users entering it

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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).

 

 

Adrian Ubeda
Mega Sage
Mega Sage

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,

If it was helpful, please give positive feedback! ✔
☆ Community Rising Star 22, 23 & 24 ☆