close dialog from form loaded into it

close dialog from form loaded into it

Hi,

i have dialog window into which i load external php file with a form.
in the form it is possible to select the image using the set of radio buttons.
once the radio button us selected there is a "Submit Form" button which shoud update some fields in a form on parent (opener) page and close the dialog.

it is all more less working but i cannot close that dialog window.

please let me know if you see some glitch in my code which causes closing not working.

  1.     $('#intro_image').click(function()
        {
           
            $('#assets_browser').load('/res_editor/assets_browser').dialog({
                autoOpen: false,
                height: 600,
                width: 800,
                modal: true
            }).dialog('open');
           
            $('#assets_browser').find('#submitform').live('click', function()
            {
                alert('submitted');
                parent.document.getElementById('intro_image_img').style.visibility='block';
                parent.document.getElementById('intro_image_img').src = $('input:radio[name=asset_image_sel]:checked').val();
                parent.document.getElementById('intro_image_id').value = $('input:radio[name=asset_image_sel]:checked').val();
                $(this).dialog('close');

            });
        });



















#intro_image - is button on parent (opener) page which opens the dialog
#assets_browser - is DIV element which is the form loaded into
#submitform - is the BUTTON element in form loaded into dialog
#'intro_image_img & #'intro_image_id - image and hidden input elements in form on parent (opener) page


thank you in advance for your help
krajicek