473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Only numbers in text Box

Hi All,
i have a text box that is created Programmatically in a table & i want to
allow only numbers in this text box ?????????
Any ideas??????????
Regards
Nov 18 '05 #1
2 1493
"Mariame" <Ma************@yahoo.com> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl...
i have a text box that is created Programmatically in a table & i want to
allow only numbers in this text box ?????????
Any ideas??????????


Do you mean that you want your page to fail validation at postback if there
are non-numeric characters in the textbox, or do you want to prevent your
users from physically typing in non-numeric characters?

Assuming the former, that's fairly easy with a validator and a regular
expression.

Assuming the latter, you'll have to create a client-side JavaScript function
called by the onmousedown() event of the textbox which disallows non-numeric
characters...
Nov 18 '05 #2
"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:uq**************@TK2MSFTNGP10.phx.gbl...
Assuming the latter, you'll have to create a client-side JavaScript function called by the onmousedown() event of the textbox which disallows non-numeric characters...


Woops - I meant, of course, the onkeypress() event!

This might help you...
http://www.experts-exchange.com/Web/..._21047343.html
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Rowan Chapman | last post by:
Hey all! I'm kinda new to VB but not to programin'. So I know what it is like when you are asked trivial questions. Could some1 please tell me what the syntax would be 2 only allow numerical data...
2
by: anonieko | last post by:
This applies to javascript dynamic textbox onkey > > > Newsgroups: comp.lang.javascript From: Lasse Reichstein Nielsen <l...@hotpop.com> - Find messages by this author Date: Fri, 15 Jul 2005...
2
by: Sreya | last post by:
Hello..I hope someone can help me with this little that I've been having for a while. I have a form..which has many fields. one of them being a test #. what I need a combo box with only certain...
11
by: Leon | last post by:
I have six textbox controls on my webform that allows the user to enter any numbers from 1 to 25 in any order. However, I would like to sort those numbers from least to greatest before sending them...
7
by: Greg Burns | last post by:
I have a textbox that I only want to allow "numbers". 1,000 1000 1000.0512 I don't want to prevent them from typing anything else, because I want to check their input in the Validating event...
6
by: Woody Splawn | last post by:
We have access to Infragistics etc., but we would like to make use of a regular VS textbox so that it accepts only numbers. We have discovered that if you bind an integer field to a textbox, for...
3
by: Tom | last post by:
Being a newbie to JS, I would appreciate some advice. When a visitor enters a number into a textbox, I want to check that it is 15 digits long and then display a message accordingly and the...
17
by: Ron | last post by:
I want to write a program that will accept a number in a textbox for example 23578 and then in a label will display the sum of the odd and even number like this... the textbox containsthe number...
2
by: Vbbeginner07 | last post by:
Hi all Wonder if anyone can help me out to solve this: please find the code of textbox that accepts only characters and one textbox that accepts only numbers: (vb) textbox for accepting...
2
by: sdanda | last post by:
Hai My textbox accepts only positive numbers.It doesnot accept even floating points also.How to this?I wrote this code //Code Dim neg As Integer = 0 If (Not IsNumeric(envno.Text)) Or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.