Disallow Special Characters to enter in text field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2013 09:27 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2013 10:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2013 10:53 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2013 11:11 AM
[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;