Hello,

I'm pretty new to jQuery and ajax in general - so excuse me for the
simple question.

Question: How can I load a whole form with load() and
after this fragment is added to the DOM of the page,
set some event handlers to some of the elements of the form?

I'm trying to load a code fragment in ready handler

$(function () {
    $('#groupForm').load('Index_groupFrag.action', setGroupListener
());
});

function setGroupListener() {
    alert($('#UpdateGroupFrag_groupId').size());
}

The alert returns size=0 and my quess is that the function is called
before Code fragment
is added to the form.

My Idea was to add another code fragment to the page on combo box
change
Something like this

function groupChange() {
    $('#UpdateGroupFrag').ajaxSubmit({
        type:'post',
        success: function() {
            $('#itemForm').clear().load('Index_ItemFrag.action');
        }
    });
}

Reply via email to