textarea maxlength

Discussion in 'HTML & Website Design' started by Jamie18, Aug 16, 2007.

  1. #1
    i was suprised not to find this topic anywhere in the forum..

    is there anyway without javascript to limit the length of a string that you can enter into a textarea? it would be convenient if the maxlength attribute would work for them but someone decided not to make things that simple
     
    Jamie18, Aug 16, 2007 IP
  2. itssangy

    itssangy Peon

    Messages:
    135
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can check for the length of the textarea's value on the server side if you don't want to do it with javascript.
     
    itssangy, Aug 16, 2007 IP
  3. Jamie18

    Jamie18 Peon

    Messages:
    201
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    so than there is no way to restrict the number of characters someone can enter in a textarea without javascript? i would have to wait for the form to be submitted than do the server side check? bushleague, i can't believe that maxlength is not an option for textarea's..

    p.s. does anyone else think dungeons and dragons when they're in the design & development forum?
     
    Jamie18, Aug 17, 2007 IP
  4. Muhammad Haris

    Muhammad Haris Peon

    Messages:
    576
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Muhammad Haris, Aug 17, 2007 IP
  5. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #5
    I think the best way would be to first code it with a server side language, so after the form is submitted the server side language would count the # of chars in the textarea, and if it was higher than X number, tell them to reduce it.

    Afterwards, you can then make a real time JS checker (like the ppk one) for people who have JS enabled.
     
    soulscratch, Aug 17, 2007 IP