user1255233
user1255233

Reputation: 37

textarea to expand by one line when text overflows

I want my text area to expand by one line only when the first line of text overflows. I don't want it to expand any further although it should allow to enter text in textarea.

I have overflow property set to hidden so that textarea appears like a input box to user.

how this can be achieved using jquery ?

Upvotes: 0

Views: 363

Answers (1)

samccone
samccone

Reputation: 10926

Hello

you can use a plugin like this http://figovo.com/ or this http://unwrongest.com/projects/elastic/ or http://www.appelsiini.net/2008/4/autogrow-textarea-for-jeditable or many many more....

and then set a CSS rule on the textarea to set a max height like this --- max-height: 150px;

hope this helps

Upvotes: -1

Related Questions