Disallow Special Characters to enter in text field

Thummala_Murthy
Kilo Contributor

Hi Friends,
I need help in scripting to "Disallow Special Characters to enter in text field".
on celledit, i want the script not to allow to type special characters(!@#$%^&*()) except Alphanumeric(A-Z & 1-9).
Can you please help me.

Thnx
Murthy

7 REPLIES 7

I'm not sure what browser are you using, But for chrome its working perfectly. Let me pull up IE.

PFA the attachment.


Thummala_Murthy
Kilo Contributor

Hi,
I am using Chrome and not ie.
also this is working @ menu where all incidents exists.
but if you open an inciden and type spl chars in field its not working.
can u pl help

thnx
murthy


[quote]Hi Friends,
I need help in scripting to "Disallow Special Characters to enter in text field".
on celledit,
[/quote]

You said you need it on Cell edit. But if you need it after opening the incident form, You have to write it onChange.

Create an onChange client script and paste in this code inside the function -




if(isLoading || newValue == '') return;


var saveAndClose = true;


saveAndClose = /^[a-zA-Z]+(\s+[a-zA-Z]+)?$/.test(newValue);
if(!saveAndClose){
alert('you entered special values');
g_form.setValue('description','');
return false;
}
return saveAndClose;