Only numbers in text Box

Discussion in 'ASP .Net' started by Mariame, Aug 19, 2004.

  1. Mariame

    Mariame Guest

    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
     
    Mariame, Aug 19, 2004
    #1
    1. Advertising

  2. Mariame

    Mark Rae Guest

    "Mariame" <> wrote in message
    news:...

    > 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...
     
    Mark Rae, Aug 19, 2004
    #2
    1. Advertising

  3. Mariame

    Mark Rae Guest

    Mark Rae, Aug 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mit
    Replies:
    1
    Views:
    815
    Ramu Pulipati
    Jan 25, 2006
  2. Gnarlodious
    Replies:
    4
    Views:
    17,611
    elizas
    May 5, 2010
  3. Anonieko Ramos
    Replies:
    1
    Views:
    92
    Michael Winter
    Oct 3, 2004
  4. Replies:
    5
    Views:
    104
    Dr John Stockton
    Mar 7, 2006
  5. Petyr David

    Text Box drop down - consecutive numbers

    Petyr David, Aug 29, 2007, in forum: Javascript
    Replies:
    0
    Views:
    101
    Petyr David
    Aug 29, 2007
Loading...

Share This Page