1. Home
  2. Computing & Technology
  3. JavaScript

Limiting Textarea Text
Introduction

By Stephen Chapman, About.com

Unlike input fields where you can use a maxlength sub-parameter to specify the maximum field length, there is no way using just html to restrict the length of a textarea field. Instead, you need to use javascript to test the length of what the user has entered as they enter it and stop accepting their input when they have reached your limit.

Let's start by looking at how the script works .

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.