Results 1 to 2 of 2

Thread: Max Character Length Q

  1. #1
    Join Date
    Jun 2003

    Max Character Length Q

    Why for small text area maxlength of characters input works, but not for big text field?
    HTML Code:
    <input name="name1" type="text" id="phone" form size="1" maxlength="3">
    <textarea name="name2" cols="40" maxlength="3" rows="10" form="form">
    How can I limit the text input of a large text field <textarea>?

  2. #2
    Join Date
    Aug 2004
    maxlength is not a valid attribute of the textarea element. (See http://www.w3.org/TR/html4/interact/forms.html#h-17.7 for more info.) Basically, if you need to limit the number of characters entered, you either need to use a input element with maxlength set, or do some sort of programatic validation on the client (e.g. JavaScript) and/or on the server at the form handler.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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