Ok, through sheer genuis (just kidding), I figured it out...

when the form is *successfully* loaded via ajax, simply call the
function for the maxlength plugin again:
$("textarea.limited").maxlength({ "feedback":".charsLeft" });

Konstantin

On Nov 15, 9:36 pm, Konstantin K <kkru...@gmail.com> wrote:
> Hey guys,
>
> I'm developing a commenting system for a site and am using the
> maxlength plugin from Remy Sharp (http://remysharp.com/2008/06/30/
> maxlength-plugin/) to limit the comments to a specific length.
>
> It works great for textareas that are loaded with the page, but it
> stops working for textareas that are loaded via ajax (for example when
> replying to a comment, the reply form is loaded from the backend via
> an ajax call)
>
> I have a feeling this has something to do with binding and this FAQ
> (http://docs.jquery.com/
> Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_requ­est.
> 3F), but I cannot figure it out.
>
> Any ideas?
>
> Thanks,
> Konstantin

Reply via email to