I am trying to find the best autogrow textarea plugin. I need one that resizes the text box, even when I insert it. Any idea?
Why not use it? http://plugins.jquery.com/project/autogrowtextarea
Or another updated version of this plugin here: https://github.com/ro31337/jquery.ns-autogrow
The elastic is very good, and it also handles CTRL + V cases.
You can visit the website and try the demo.
This is the one I used. Work so far!
http://www.jacklmoore.com/autosize/
The jQuery Elastic plugin is slow and does not work for me in IE8.
I used the following method in jQuery .
jQuery
setInterval(function(){ $(name_textarea).css('height', $(name_textarea)[0].scrollHeight+2+'px') },100);
Try it, you can change scrollHeight to get the best results.
scrollHeight
You can try Advanced Textarea. Download from http://www.jscripts.info
I made another plugin for this, check it out here: https://github.com/AndrewDryga/jQuery.Textarea.Autoresize
"I need one that resizes the text box, even when I paste it"
this method also listens for copy / paste events: stack overflow
I think that in modern browsers these events can be replaced with an βinputβ event, but in an earlier browser this method will not work.
Here is another plugin that also supports horizontal enlargement of text areas:
https://github.com/dgbeck/jquery.autogrow-textarea
It is also based on a βmirrorβ approach, but reverts to simple math in IE 8 and lower, since the mirror approach results in IE and lt = 8.