Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1662 Is there a way to restrict number of characters within a textarea?

irt.org | Knowledge Base | JavaScript | Form | Q1662 [ previous next ]

Q1662 Is there a way to restrict number of characters within a textarea?

Try:

<form>
<textarea onKeyUp="if (this.value.length > 100) { alert('100 chars max'); this.value = this.value.substring(0,99); }">
</textarea>
</form>

Feedback on 'Q1662 Is there a way to restrict number of characters within a textarea?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.