Auto-Growing Textarea with jQuery and MooTools

Posted on August 11, 2009, under JavaScript,  Bookmark it

AutoGrowing Textarea JQuery Plugin was inspired by Facebook’s auto-expanding text areas and makes it easy to have auto-growing textareas. The textarea grows and shrinks to fit it’s content, but does not exceed the minimum height you specify via CSS.

jquery-growing-textarea

Required TextArea CSS Attributes:

  • line-height
  • min-height

You are required to have some basic styles for your textarea for it to work properly, but it’s really not that hard. The solution is simply to create a hidden div that mimics the textarea’s style and then when the height of the div surpasses the height of the textarea, we adjust the size of the textarea.

Flext: MooTools Auto-Growing Textrea Plugin, by Graham McNicoll

flext-mootools auto-growing-textrea-plugin

Features include:

  • Very easy to implement
  • Grows text areas when needed
  • Maximum Height to Grow To
  • Can grows parents if they have a fixed height
  • Ghost text/text overlay for input context and help
  • Text input emulation (enter can submit form, instead of new line)

Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!

Get our RSS Feed!

Leave a Reply


* = required fields

  (will not be published)


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Note: If you want to post CODE Snippets, please make them postable first!
(e.g. <br /> should be converted to &lt;br /&gt;)