Limit to 150 characters in multi-line textbox

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Limit to 150 characters in multi-line textbox

    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 Guest

  2. Similar Questions and Discussions

    1. Limit the Number of Characters Returned
      I am running into a problem with a dynamically created Select Box being too wide due to the names included in it. How can I limit the length of the...
    2. Multi-line TextBox - Paste text with numbered list, bullet list, tab character
      Hi All, I need a server control that's exactly like a multi-line TextBox, but also allow users to paste text with numbered list, bullet list, and...
    3. Limit off 255 characters
      Hello! I have a Visual FoxPro table with Memos fields, and when i insert into the table a value that cames from a TEXTAREA field on a form, give me...
    4. Textarea - Limit Amount of Characters?
      "Ralph Freshour" <ralph@primemail.com> wrote in message news:cr6bkvc5rsi9o355ff50c7746iu0omq6kk@4ax.com... I suspect *limiting* the amount of...
    5. >4000 characters in a TextBox
      I'm having the same problem. Basically, what I need to know is - Can I move more than 4000 characters from a TextBox in a Web Form to a string? If...
  3. #2

    Default Re: Limit to 150 characters in multi-line textbox

    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" <field027_nospam_@umn.edu> wrote in message
    news:uSyVxzoWDHA.536@TK2MSFTNGP10.phx.gbl...
    > 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 Guest

  4. #3

    Default Re: Limit to 150 characters in multi-line textbox

    | 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, [url]http://www.altaircom.net[/url]
    Please do not reply to this e-mail, for contact see [url]http://www.rider.cz[/url]


    Michal A. Valasek Guest

  5. #4

    Default Re: Limit to 150 characters in multi-line textbox

    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:
    [url]www.aboutfortunate.com[/url]. 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:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "Mark" <field027_nospam_@umn.edu> wrote in message
    news:uSyVxzoWDHA.536@TK2MSFTNGP10.phx.gbl...
    > 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 Guest

  6. #5

    Default Re: Limit to 150 characters in multi-line textbox

    Take a look @ Recent tips and tricks Validating MaxLength of the TextArea using CustomValidator Topic:[url]http://www.aspnet101.com/aspnet101/tips.aspx[/url]

    "Mark" <field027_nospam_@umn.edu> wrote in message news:uSyVxzoWDHA.536@TK2MSFTNGP10.phx.gbl...
    > 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] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139