• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 91
  • Last Modified:

Restricting Input in HTML Textboxes to Numeric Values

Restricting Input in HTML Textboxes to Numeric Values
Sathish David  Kumar N
Sathish David  Kumar N
1 Solution
Test page : http://jsfiddle.net/uz1xweoh/

$("#THISISMYID").on("keyup blur focus paste", function() { 
      $(this).val( $(this).val().replace(/\D/g,"") );

Open in new window

Hans LangerCommented:
If you are using jquery would recommend you this plugin. its works to validate the most common formats, money, date, etc..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now