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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -