JavaScript

  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

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

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

JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Controls and Widgets
  5. Form Controls
  6. Limiting Textarea Text Using JavaScript

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

All rights reserved.