Automatically Expand Textarea When Character Limit Is Exceeded | jQuery textpandable.js

Textpandable Plugin is an easy and configurable Textarea extension jQuery plugin that automatically inserts a new row into the textarea when its content exceeds a certain number of characters.

This jQuery plugin was originally published on my blog in June 2009. This plugin has been used and modified for use in many personal and work-related projects but has not been maintained long term.

auto expand input height based on text length, auto resize textarea to fit content, textarea auto expand width, auto resize textarea to fit content css, auto expand input width based on text length

Textpandable in ActionTextpandable provides the following options:

lineHeight: Specify the line-height of the text area – as a Textpandable or CSS declaration option.
minRows and maxRows: Set limits on how small or large the text area can be.
Padding: Set a number of additional rows to provide padding. 1-2 rows are usually a good value.
Width: The number of characters allowed per line before an additional row is added. If not set, Textpandable does its best to specify safe values ​​based on CSS declarations, column attributes, and/or pixel widths.

Add Cascading Animations To Individual Characters or Elements Using Vanilla JavaScript

How to make use of it:

1. Insert the JavaScript textpandable.js after loading the newest jQuery library.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/textpandable.js"></script>

2. Initialize the plugin on the goal textarea component and executed.

<textarea>... </textarea>
$(function(){
  $('textarea').textpandable();
});

3. Set the min/max variety of rows. -1 means infinity.

$('textarea').textpandable({
  minRows: 1,
  maxRows: -1,
});

4. Set the utmost variety of characters allowed in a line. When this restrict is exceeded, the plugin will add a brand new row to the textarea.

$('textarea').textpandable({
  width: 10
});

5. Set the padding & line-height properties of the textarea.

$('textarea').textpandable({
  padding : 1,
  lineHeight: "1.4em",
});

6. Apply an easy transition to the textarea when increasing & collapsing.

$('textarea').textpandable({
  speed: 200,
  initSpeed: -1,
});

Auto Expand Textarea When Exceeding Character Limit, Textpandable Plugin/Github, how to increase textarea height dynamically, textarea character limit jquery, textarea no scrollbar auto height


See Demo And Download

Official Website(thomshouse): Click Here

This superior jQuery/javascript plugin is developed by thomshouse. For extra advanced usage, please go to the official website.

Related Posts

svg-pan-zoom-container

Adding Zoom-on-Wheel and Pan-on-Drag to Inline SVG Elements

Vanilla-js module for adding zoom and panning behavior when dragging to SVG embedded elements. A lightweight Vanilla JavaScript plugin that enables zoom and pan functions on an…

html-table-sortable-js

Sorting HTML Table Vanilla JavaScript Library | Sortable.js

Sortable – Small JS vanilla table sorter makes any table with class = “sortable“, er, sortable. That is, the user can click the table header and change…

WYSIWYG-Rich-Text-Editor

WYSIWYG Rich Text Editor With jQuery And FontAwesome | RichText

RichText jQuery implementation for WYSIWYG Rich Text Editor which uses Font Awesome Iconic Font for editor icons. It is licensed under AGPL-3.0. Initialize editor Simply call .richText() on your jQuery(‘textarea’) or jQuery(‘input’)…

email-domain-autocomplete-genie

[Autocomplete] Email Domain Suggestions Like Gmail, Outlook, or More | email-genie

Email Genie allows auto-completion in the email field by providing a list of domain suggestions (gmail.com, outlook.com, etc.). This package is lightweight, flexible, compatible with libraries (jQuery,…

JavaScript-Library-for-Creating-Squircley-Magic

[Generator] JavaScript Library for Creating Squircley Magic ✨ | squircley.js

squircley.js is the core magic of Squirclular ✨ from https://squircley.app wrapped in a simple 0-dependency JavaScript library. squircley.js can generate SVG files, add square backgrounds to DOM…