Limit to 150 characters in multi-line textbox

Discussion in 'ASP .Net' started by Mark, Aug 4, 2003.

  1. Mark

    Mark Guest

    Can you limit the number of characters in a multi-line textbox? My tests in
    indicate that the MaxLength property causes client side limits only on
    single line textboxes.

    Thanks in advance!

    Mark
    Mark, Aug 4, 2003
    #1
    1. Advertising

  2. Mark

    Marina Guest

    If this doesn't work on multiline textboxes, you will have to write
    javascript to handle the onkeydown event or something like that, to prevent
    the user from entering more then 150 characters.

    "Mark" <> wrote in message
    news:...
    > Can you limit the number of characters in a multi-line textbox? My tests

    in
    > indicate that the MaxLength property causes client side limits only on
    > single line textboxes.
    >
    > Thanks in advance!
    >
    > Mark
    >
    >
    Marina, Aug 4, 2003
    #2
    1. Advertising

  3. | Can you limit the number of characters in a multi-line textbox? My tests
    in
    | indicate that the MaxLength property causes client side limits only on
    | single line textboxes.

    You cannot. Recommended way is to use validator.

    --
    Michal A. Valasek, Altair Communications, http://www.altaircom.net
    Please do not reply to this e-mail, for contact see http://www.rider.cz
    Michal A. Valasek, Aug 4, 2003
    #3
  4. Mark,

    It is documented that MaxLength only works while a text box is in single
    line mode.

    However, you may use a regular expression validator to control the length
    of the text box. I have sample code for this on my web site:
    www.aboutfortunate.com. Just go to the code library and search for: "text
    area length validation".

    I hope this helps.

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche
    "Mark" <> wrote in message
    news:...
    > Can you limit the number of characters in a multi-line textbox? My tests

    in
    > indicate that the MaxLength property causes client side limits only on
    > single line textboxes.
    >
    > Thanks in advance!
    >
    > Mark
    >
    >
    S. Justin Gengo, Aug 4, 2003
    #4
  5. Take a look @ Recent tips and tricks Validating MaxLength of the TextArea using CustomValidator Topic:http://www.aspnet101.com/aspnet101/tips.aspx

    "Mark" <> wrote in message news:...
    > Can you limit the number of characters in a multi-line textbox? My tests in
    > indicate that the MaxLength property causes client side limits only on
    > single line textboxes.
    >
    > Thanks in advance!
    >
    > Mark
    >
    >
    Sonali.NET[MVP], Aug 4, 2003
    #5
    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. SR
    Replies:
    2
    Views:
    346
    Jack Klein
    Jan 17, 2004
  2. Replies:
    1
    Views:
    305
    David
    Apr 22, 2007
  3. Replies:
    13
    Views:
    2,184
    Martin v. Löwis
    Apr 18, 2008
  4. Beau Gould
    Replies:
    0
    Views:
    323
    Beau Gould
    Nov 5, 2008
  5. hackerspk

    Over 150 PSP Games

    hackerspk, Jan 9, 2009, in forum: Python
    Replies:
    0
    Views:
    430
    hackerspk
    Jan 9, 2009
Loading...

Share This Page