dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Max Character Length Q

  1. #1
    Join Date
    Jun 2003
    Posts
    446

    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
    Location
    Ankh-Morpork
    Posts
    19,623
    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.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

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



Recent Articles