Following is the code snippet for checking alphanumeric characters.
var testId = "1123ASD";
if((testId.search(/[^a-zA-Z0-9 ]/g)) {
alert("Matched");
}
else {
alert("Invalid");
}
//you can enter characters like + - *^$%^$, etc to check it
I hope this helps someone like me.
No comments:
Post a Comment