Friday, October 9, 2009

Special Character Validation

var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?~_";

for (var i = 0; i < objGridCellValue.length; i++)
{
if (iChars.indexOf(objGridCellValue.charAt(i)) != -1) {
alert ("Your string has special characters. \nThese are not allowed.");
return false;
}
}