My application is in Arabic and English. Its a hybrid application (html/css/jquery/android). we have one text field in one page and it should take input only alphanumeric (i.e., abc123). i want to prevent input other than alphanumeric. ( some customer are using Arabic keyboard and they enter something else from Arabic keyboard. and here it showing question marks (?) in database.)
So I have to prevent input other than alphanumeric. Please suggest me how can i prevent to take input as arebic or anything other than alphanumeric. Thanks in advance.
this is my code...
function isAlphaNumeric(e){
var k;
document.all ? k=e.keycode : k=e.which;
return((k>47 && k<58)||(k>64 && k<91)||(k>96 && k<123)||k==0);
}
<input type="text" OnKeypress="javascript:return isAlphaNumeric(event,this.value);" >