Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Only numbers in text Box

Reply
Thread Tools

Only numbers in text Box

 
 
Mariame
Guest
Posts: n/a
 
      08-19-2004
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


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      08-19-2004
"Mariame" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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...


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      08-19-2004
"Mark Rae" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
Text Box drop down - consecutive numbers Petyr David Javascript 0 08-29-2007 12:27 PM
Numbers from a text box for calculation adam.waterfield@gmail.com Javascript 5 03-07-2006 10:13 PM
how to selecet check box in the data grid ?? only one check box mit ASP .Net 1 01-25-2006 06:47 PM
Is There an example on how to acces numbers only in Text Field? Anonieko Ramos Javascript 1 10-03-2004 09:44 AM



Advertisments