1. Home
  2. Computing & Technology
  3. JavaScript

Limiting Textarea Text

Introduction

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

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

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

  1. Home
  2. Computing & Technology
  3. JavaScript

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

All rights reserved.