Set the Maximum Length for TextArea in a form

Results 1 to 2 of 2

Thread: Set the Maximum Length for TextArea in a form

  1. #1
    Join Date
    Dec 1969

    Default Set the Maximum Length for TextArea in a form

    well i want to restrict the user from entering more than 200 characters in a TEXTAREA in a form....Can i do it by setting the MAXLENGTH property to 200 or is there a different way??? <BR><BR>i tried the maxlength peoperty but i didn&#039;t get what i wanted to..pls help

  2. #2
    Join Date
    Dec 1969

    Default I guess this should be FAQ?

    Except that it&#039;s an HTML question and we don&#039;t have any HTML categories in the ASPFAQs, since this is after all an ASP forum.<BR><BR>Anyway: You can&#039;t. Period.<BR><BR>The best you can do is monitor the size of the text (say once a second?) and, if it gets too big, issue a warning and/or chop it off. Some people have suggested capturing keystrokes, but that&#039;s a pain (what about backspace? delete? other non-display characters?) and doesn&#039;t handle a copy/paste into the text area. I think a timer-based solution is easier and more than adequate.<BR><BR>This *might* be answered in more detail in the JavaScript FAQ at

Posting Permissions

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