Sunday, 18 December 2011

Characters Validation

Characters Validation
 You want to Type only Characters then use this Function if you Type numeric the return false

var charSetName="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
function isName(myst) {
var i;
for (i = 0; i < myst.length; i++) {
var c = myst.charAt(i);
if (charSetName.indexOf(c) < 0) {
return false;
}
}
return true;
}

No comments:

Post a Comment