Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js addeventlistener input searcb mobile

//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 :: remove the last character from a string in JavaScript, 
Javascript :: node js create or check directory 
Javascript :: SHOPIFY COUNTRY SELECTOR 
Javascript :: javascript conditional 
Javascript :: Image preload React 
Javascript :: vue mixin example 
Javascript :: get field type file js and loop 
Javascript :: moyenne javascript 
Javascript :: gsap keyframes 
Javascript :: react useeffect on change props 
Javascript :: Create Your Vue Project 
Javascript :: assign freemarker expressions to variables 
Javascript :: graphql yoga access http headers 
Javascript :: buscar una frase e un string js 
Javascript :: vuejs enter phone with country flag 
Javascript :: jest called times 
Javascript :: Invalid prettier configuration file detected. See log for details. 
Javascript :: javascript match 
Javascript :: react-with-firebase-auth 
Javascript :: Find All Less Than Equal To In MongoDB 
Javascript :: js regex 
Javascript :: Material-ui Accessibility icon 
Javascript :: set time slots with date in javascript 
Javascript :: news api react native 
Javascript :: javascript sort two-dimensional array by column 
Javascript :: Update failed: ChunkLoadError: Loading hot update chunk app failed. 
Javascript :: lite youtube embed react 
Javascript :: npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. 
Javascript :: javascript undefined 
Javascript :: js round floar 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =