Re: Limit entry into TextArea
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Limit entry into TextArea

From: impaler <TamasJano@gmail.com>
Date: Tue Jan 31 2006 - 15:28:03 CET

JohnSouth wrote:
> Hi
>
> In a TextBox I can set a maximum size for the entry.
> Is there a way of limiting the number of characters being entered into
> a TextArea control?
>
> John South
> www.wherecanwego.com

<textarea onkeypress="if (this.value.length > 200) this.value =
this.value.substr(0, 200);">
</textarea>

do this on onblur too, to avoid copy paste and if there are other
scenarios to put more too.
Received on Tue Feb 7 21:28:47 2006