Max length for text area

Results 1 to 3 of 3

Thread: Max length for text area

  1. #1
    Troy Guest

    Default Max length for text area

    Can anyone tell me how I can set the length that can be typed in a text area? I don't want the site's viewers to be able to type as much as they want.

  2. #2
    Bill Spurling Guest

    Default RE: Max length for text area

    Troy,<BR>Try Something like this.<BR>Where the XXX represents the number of characters you want<BR>&#060;textarea name="comment" cols="60" rows="3" onKeyUp=f1(this,XXX) onKeyDown=f1(this,XXX) onFocus=f1(this,XXX) onChange=f1(this,XXX)&#062;&#060;/teaxtarea&#062;<BR>&#060;script language="JavaScript1.1"&#062;<BR>&#060;!--<BR> function f1(a,b){<BR> x = b - a.value.length;<BR> if (x &#060; 0) { a.value = a.value.substring(0,b); x = 0; }<BR><BR>//--&#062;<BR>&#060;/script&#062;<BR><BR>Hopefully, this will work<BR><BR>Bill<BR>

  3. #3
    Troy Guest

    Default That worked great thanks!

    That worked great thanks!

Posting Permissions

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