Option to limit the number of caracters in <textarea> ?

Discussion in 'HTML' started by freeposte, Dec 1, 2008.

  1. freeposte

    freeposte Guest

    Good morning dear members of the alt.html newsgroup.

    Is there any option to limit the number of characters in a text area
    (<textarea> tag) ?

    Many thanks.

    freeposte
     
    freeposte, Dec 1, 2008
    #1
    1. Advertisements

  2. freeposte

    +mrcakey Guest

    Only by using JavaScript.

    +mrcakey
     
    +mrcakey, Dec 1, 2008
    #2
    1. Advertisements

  3. 19:00 is an odd time for "good morning".
    It depends on what you mean by "option" and "limit" and "is there". But the
    interesting question is why you would do this.

    I'd suggest starting from
    http://www.cs.tut.fi/~jkorpela/forms/textarea.html
    which should at least help you to formulate a useful question.

    (Within HTML, the answer is of course "No", but you surely knew this - it
    was easy to check this from HTML specifications and references, wasn'it it?)
     
    Jukka K. Korpela, Dec 1, 2008
    #3
  4. freeposte

    freeposte Guest

    That's right. thanks.
     
    freeposte, Dec 1, 2008
    #4
  5. freeposte

    Tim Greer Guest

    You can try some methods, such as JavaScript, but you should always
    ensure you do some checking server-side. Anything too large, either
    reject immediately and warn the user, or truncate it to an acceptable
    length. There are simply too many methods people could use to bypass
    any attempt to put a limit on the characters, so anything you can do
    would be only an attempt to make things more user friendly, if their
    browser supports whatever you feature impose for that purpose.

    So, if you need a limit imposed for more than the visual aspect while
    someone fills in the textarea field, be sure the program/script it
    submits that data to does the real checking. Also, I'd recommend
    against forcing the feature (JavaScript, or whatever) to make people
    "able" to submit it, but just to enhance it if they happen to have it
    enabled. Same rule as anything and any design for function on a site,
    I suppose.
     
    Tim Greer, Dec 1, 2008
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.