Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js addeventlistener keyup android

//This is because your Android has no real keyboard attached,
//it has a virtual one and it does not fire key- events.
//Since you're working with <input>, listen for input event instead of keydown or keyup.
//It solves your problem and also helps to handle paste.


document.getElementById("FirstName").addEventListener("input", alphaOnly, false);
document.getElementById("Surname").addEventListener("input", alphaOnly, false);


function alphaOnly(event) {
  event.target.value = event.target.value.replace(/[^a-z]/ig, '');
}

<input id="FirstName"><br>
<input id="Surname">
Comment

PREVIOUS NEXT
Code Example
Javascript :: cannot read property of undefined reading create material ui 
Javascript :: react native communicate with webview 
Javascript :: textarea events react testing library 
Javascript :: node js create pdf from html 
Javascript :: javascript online compiler 
Javascript :: how to hide api key in react 
Javascript :: angular cli spec test false 
Javascript :: script defer attribute 
Javascript :: javascript wait to execute function on keyup 
Javascript :: javascript filter array return index 
Javascript :: how to use crypto module in nodejs 
Javascript :: how to use cordova screen shot 
Javascript :: forward and reverse loop one by one js 
Javascript :: js recursive fetch 
Javascript :: time zone browser javascript 
Javascript :: camel case first javascript 
Javascript :: react proxy error: could not proxy request from localhost:3000 to http localhost:5000 econnreset 
Javascript :: random number generator 
Javascript :: create a javascript json object 
Javascript :: javascript sleep 1 minute 
Javascript :: react native image zoom viewer 
Javascript :: fluent validation email address regex 
Javascript :: chart js more data than labels 
Javascript :: how to adjust brightness with a slider in javascript 
Javascript :: get row data in datatable 
Javascript :: localstorage getitem 
Javascript :: hammerjs 
Javascript :: electron vue printer 
Javascript :: vscode read environment variables 
Javascript :: javascript events 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =