Click here to Skip to main content
15,893,487 members
Articles / Web Development / HTML

Text box to accept only number

Rate me:
Please Sign up or sign in to vote.
4.13/5 (21 votes)
23 Apr 2011CPOL 92.7K   26  
Text box to accept only number

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
27 Dec 2011Nigam Patel
Here is a really simple code for a numeric text box and it will work in all browsers. Only works for web applications. function CheckNumeric(e) { if (window.event) //...
Please Sign up or sign in to vote.
28 Apr 2011pankajupadhyay29
I have created a jQuery code to achieve this/*User Options --allowHex:Allow hexadecimal number default falseallowNeg:Allow negative default falseonlyInteger:did not allow decimal default true*/$(function () { var mergedOptions = {}; var common = { allowHex:...
Please Sign up or sign in to vote.
24 Apr 2011Sander Rossel
The following Class is a TextBox for WinForms that only accepts 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (numerics) or backspace as input. Not using regular expressions.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Forms;namespace...
Please Sign up or sign in to vote.
29 Dec 2011Manish K. Agarwal
WinForms TextBox to accept numbers in a range[^]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer India
India India
http://devcorners.com/
Total DotNet/Programming Solution

I am Prasanta Banerjee. I am an Asp.Net Developer. My site: http://devcorners.com/
Email: prasanta.it@hotmail.com
If any body wants to prepare for interview http://guru-code.blogspot.com/ is the good site.

Comments and Discussions