I am using jQuery as my Javascript library. Is there any way to make a textbox grow to fit the size of its contents?
Asked
Active
Viewed 3,437 times
0
-
1Possible duplicate: http://stackoverflow.com/questions/931207/is-there-a-jquery-autogrow-plugin-for-text-fields – Christian C. Salvadó Nov 30 '09 at 04:30
3 Answers
2
This is the best implementation I have found, it's lightweight and has worked wherever I have used it.
http://onehackoranother.com/projects/jquery/jquery-grab-bag/autogrow-textarea.html
It will grow and shrink according to text size.

going
- 9,669
- 4
- 36
- 37
1
-4
Yes.
However, as a user, I would be against it. Why not make the textbox large enough to store my input in the first place?

strager
- 88,763
- 26
- 134
- 176
-
3I don't think this is a very useful answer strager, more of a comment. I'm sure there's a neat design concept there you've pooed on. – jay Nov 30 '09 at 04:50
-
-
The most obvious reason why not is that it's one of those little text boxes that's just sitting around waiting for you to enter text into it, but most of the time you're just going to ignore it. Facebook has lots of examples of this. The box starts small and unobtrusive but as you type it grows as needed. – Nate C-K Nov 30 '09 at 05:42