function isAlphaNumeral(elm,field_name){
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789., ";
if(!checkChars(elm.value,chars)){
alert(field_name+" is invalid");
elm.select();
return false;
}
return true;
}
function checkChars(val,chars){
var flag = false;
for(i=0; i < val.length; i++){
ch_data = val.charAt(i);
for(j=0; j < chars.length; j++){
if(ch_data==chars.charAt(j)){
flag = false;
break;
}
flag=true;
}
if(flag){
return false;
}
}
return true;
}< val.length; i++){
< chars.length; =""
No comments:
Post a Comment
Please comment on this