Closing .load Dialog fails

Closing .load Dialog fails

Hello,

i've git a Problem. Everytime i test to close a .load jquery dialog, nothing happens. Hers the Code:

  1.    function contentloaderBea(dataid) {
        $("#somediv").load("Mieter.php?s=mbearbeiten&mieterid="+dataid+"").dialog({
            modal:true,
            autoOpen: false,
            title: 'Mieter Bearbeiten',
            position: 'center',
            width:'500',
            height:'300',
            buttons: {
                    "Save": function() {
                        $("#bearbeiten").submit();
                        $( this ).dialog( "close" );
                    },
                    "Abbrechen": function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
      }

















HTML Code:
  1. <a class="edit" onclick="javascript:contentloader(<?=$m['mieterid']?>);$('#somediv').dialog('open')" href='#'>
  2. <div id='somediv'></div>

Does the save function does his Job (the form name under mieter.php is name="bearbeiten"

Many thanks

Kind regards,
lugaru