Skip to content
Advertisement

Tag: input-field

How to get a number value from an input field?

I have some issues with calculating some stuff with JS and getting the right values out of the input fields (number). When I use this code it doesn’t show anything. So what is wrong with my JS? Do I need to include a jQuery file? Answer You had some mistakes in your HTML, but here is a working JSFiddle: Fiddle

How to force input to only allow Alpha Letters?

using jQuery here, however unable to prevent numbers from being typed into the input field http://codepen.io/leongaban/pen/owbjg Input jQuery I’ve seen plenty of examples here on how to restrict to only Numbers, and I’m using the correct key codes for a-z and A-Z. Do you see what I’m doing wrong? Answer The property event.key gave me an undefined value. Instead, I

Advertisement