How to set an input box that will only accept numeric values?
lloydsbackyard 0 Light Poster
Recommended Answers
Jump to PostYou'll need to use some Javascript, unless HTML5 is supported.
Jump to PostUse clients side and server side techniques.
First, you can use HTML5 input type number to restrict only number entries:
<input type="number" name="txtBox1" />
This will work only in browsers that support this HTML5 input type.
Next is JavaScript...
function isNumber(e) …
All 6 Replies
pritaeas 2,211 ¯\_(ツ)_/¯ Moderator Featured Poster
JorgeM 958 Problem Solver Team Colleague Featured Poster
lloydsbackyard 0 Light Poster
lloydsbackyard 0 Light Poster
lloydsbackyard 0 Light Poster
JorgeM 958 Problem Solver Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.