View Full Version : Jquery with dynamically added forms

03-28-2011, 06:55 PM
I use jquery appendTo function to add new textarea forms dynamically and I also use jquery autoResize plugin to automatically change the height of the textarea while typing. Here is the code:

$('textarea.text').autoResize({limit : 300});

The problem is that the auto resize doesn't work with dynamically added forms! It works fine with other inline forms... Can anyone please tell what is the problem?

03-28-2011, 07:09 PM
Did you call .autoResize() before or after the forms have been added dynamically?

03-28-2011, 08:28 PM
I call it once on page load...

$(document).ready(function() {
$('textarea.text').autoResize({limit : 300});

03-28-2011, 08:44 PM
You'll have to call it (again) after the additional elements have been added. Otherwise autoResize can not know anything about them.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum