Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js addeventlistener input search phone

//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 :: array destructuring by using spread operator from a nested object in javascript 
Javascript :: download string as file express js 
Javascript :: export to excel on button click in javascript 
Javascript :: how to make html with jquery 
Javascript :: hook usePreloadImages 
Javascript :: json server start code 
Javascript :: nohup nodemon 
Javascript :: apollo graphql 
Javascript :: how to get the lower triangular matrix out of a matrix matlab 
Javascript :: js number to string 
Javascript :: what is angularjs 
Javascript :: make object move towards player p5js 
Javascript :: check if browser is chrome mobile 
Javascript :: js get data url of pdf 
Javascript :: get contents between tags javascript 
Javascript :: add css class to button javascript 
Javascript :: sequelize update index column 
Javascript :: stale element reference: element is not attached to the page document 
Javascript :: regex contains special characters javascript 
Javascript :: node api return file 
Javascript :: upload image in firebase storage react web 
Javascript :: how to find dates in a string in js 
Javascript :: deno vs node 
Javascript :: arguments object in javascript 
Javascript :: javascript sort 2d array 
Javascript :: Get google maps getplace lat and long 
Javascript :: chart-js-2 
Javascript :: angular async 
Javascript :: javascript check if string is empty 
Javascript :: regular expression for beginners javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =