Mystagogos wrote:
I have a question on using jQuery in a page that I call using AJAX.  I
am using Klaus Hartl's "tabs" plug-in and using its AJAX capability.
My problem is this.  Clicking on a tab gives me a form that I have
wrapped in a div tag.  That form needs to use jQuery's form plug-in
and other functions I've written that were initialized when the main
page was rendered. How do I get the main page to recognize the new DOM
elements that were injected by the AJAX call?  I would like to use the
jQuery form plug-in options on the called form.  Do I have to re-
initialize jQuery or use one of the DOM manipulation options in jQuery
such as append(), insertAfter(), wrap(), etc?

Thanks much for your help and thanks to Klaus and all you jQuery plug-
in writers!


Mystagogos,

use the onShow callback to initialize the form after it has been loaded, like:

$('#tabs').tabs(
    remote: true,
    onShow: function(clicked, show, hide) {
        $('form', show).ajaxForm();
    };
);


--Klaus

Reply via email to