Special character Validation

Lakhangarg
Posted by Lakhangarg under JavaScript category on | Views : 3669
function chkSpecialChars(input)
{
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?"; for (var i = 0; i < input.length; i++)
{
if (iChars.indexOf(input.charAt(i)) != -1)
{
alert ("You are using special characters. \nThese are not allowed.\n Please remove them and try again.");
return false;
}
}
return true;
}


Thanks & Regards
Lakhan Pal Garg

Comments or Responses

Login to post response