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

Confetti-Falling-Animation-Effect-party

Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…

jquery-cookie-consent

Simple jQuery Cookie Consent Plugin

jquery.cookie-consent is a simple jQuery plugin to request consent to use cookies. An easy-to-use and highly customizable cookie consent bar that informs your visitors of the use…

Timepicker-Plugin-for-jQuery

Timepicker JavaScript Plugin for jQuery Inspired by Google Calendar

jquery.timepicker is a lightweight jQuery timer plugin inspired by Google Calendar. It supports both mouse and keyboard navigation and weighs 5.5KB minified and compact. Features: Highly customizable…

angular-ngx-carousel-slider

A Lightweight, Touchable, and Responsive Angular Universal Carousel Library

ngxCarousel is a lightweight, tactile, and responsive library for creating an angular carousel. No dependencies, no more hammer. Must Read: Angular Responsive Image Slider With Lightbox Popup…

random-number-picker

Generate a Random Number Picker In Vanilla JavaScript

Random Number Picker is a Vanilla JS-based number picker that allows you to generate a random number within a specified range. Must Read: Generating Lottery Numbers Using…

Nepali-Date-Picker-jQuery-Plugin

Nepali Date Picker jQuery Plugin | nepaliDatePicker

Nepali Date Picker is a customizable, easy-to-use, and input-based date picker plugin mostly based on the Nepali calendar. Users can choose a Nepali date in the navigable…