jQuery dialog form submission failure

jQuery dialog form submission failure

I'm loading some dynamic contents using jQUERY load as:

$('#modal-container').load($(this).attr('href')). dialog({ maxWidth:550, maxHeight: 300, width: 400, height: 250, modal: true, title: 'Dialog', buttons: { "Update": function() { alert('submitted ('+$(this).attr('href')+')'); $(this).find('form:first').ajaxForm({ success: function(data, status) { if(data.status == 'success') { notify('Success'); } else { notify('Error'); } }, error: function() { alert('failed'); notify('Error'); }, }); $(this).dialog("close"); }, Cancel: function() { $(this).dialog("close"); } }, close: function() { } });

load() basically loads this HTML:

<div id=“my-modal"> <form action=“/data/update" method="post> <input type="text" value=“value1”> <input type="text" value=“value2”> </form>

However on the dialog when I click 'Update' it doesn't submit the form and the PHP doesn't receive anything, could anyone please help me submitting this form through jQuery load() and dialog().

(I'm using jQuery ajaxForm plugin to submit the form)