javascript - how can i prevent to take input onkeypress anything other than alphanumeric -


my application in arabic , english. hybrid application (html/css/jquery/android). have 1 text field in 1 page , should take input alphanumeric (i.e., abc123). want prevent input other alphanumeric. ( customer using arabic keyboard , enter else arabic keyboard. , here showing question marks (?) in database.)

so have prevent input other alphanumeric. please suggest me how can prevent take input arebic or other alphanumeric. in advance.

this 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);" >

add in xml:

android:digits="abcdefghijklmnopqrstuvwxyz1234567890 " 

Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -