dialog form fails on 2nd submission
Hi There,
I have a series of dialog forms that are launched from a table, The code below allows me to launch and submit each form successfully to edit administrator accounts. However, if I edit an administrator, submit and then try and edit the same administrator again it fails on the 2nd run. Is it caching the response?
- $(function() {
var $loading = $('<img src="<?php echo "" . SS_ADMINURL . "";?>images/widgets/loading.gif" alt="loading" class="loading">');
$('#admins td a.edit').each(function() {
var $dialog = $('<div></div>')
.append($loading.clone());
var $link = $(this).one('click', function() {
var current_aduid = $link.attr('id');
$dialog
.load($link.attr('href') + '#content')
.dialog({
title: $link.attr('title'),
width: 600,
height: 430,
modal: true,
buttons: {
"Save": function () {
var formData = $("#editadmin_" + current_aduid + "").serializeArray();
$(this).dialog("close");
$.ajax({ type: "POST", url: "<?php echo "" . SS_ADMINURL . ""; ?>administrators/ssbin/do_edit_administrator.php?aduid=" + current_aduid + "", data: formData, "success": function() {
$('#tabs').tabs('load', 0);}});
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
$link.click(function() {
//current_aduid = $(this).attr('id');
$dialog.dialog('open');
return false;
});
return false;
});
});
});