TenVolt
                          Tech Notes
JavaScript > Expanding a articles:

 • Automatically adding rows or expanding a textarea as you type so you can always see all the text

Return to index of articles

Automatically adding rows or expanding a textarea as you type so you can always see all the text

Category: JavaScript
Category: Expanding a

Background

As part of the user requirements for a web-based application I was working on, the user asked if the text boxes they typed in could automatically expand as they type, so they could always see what they had previously typed without having to scroll up. A quick search of the web reveals this Internet Explorer-only solution:

This code will automatically set the height of the textarea to the "scrollheight" whenever the text in the textarea changes, thereby making it expand by adding rows as you type.

10/6/2004

Source: Visit

 TuneVault
 Music & MP3's
 10v Calendar
 Online & Easy
 Craigger
 Various & Misc.
 RetroVault
 Toys Toys Toys!
   

All contents ©2003 Ten Volt Consulting. All rights reserved.
Unauthorized duplication or use is a violation of applicable laws.
Webmaster Contact