Back to Snippets List

form - Form Textarea

<textarea data-auto-size class="form-control form-control-1-1" name="important-details" id="important-details" rows="3"></textarea>

<textarea data-auto-size data-char-count="500" maxlength="500" class="form-control form-control-1-1" name="important-details" id="important-details" rows="3"></textarea>

A vertically-growing text area

This is a vertically-growing textarea element, which can optionally count - and even limit - the number of characters in the box.


Options

Option Type Description
data-auto-size bool Resize the textarea to fix text with no maximum height, even when the browser when changes
data-char-count attribute Count the characters in the textarea. Does not disable typing into the box when the limit is reached
maxlength="500" attribute Set a maximum character count, which does disable typing
rows="3" attribute Set initial height (this can also be done in CSS alone)