Skip to content

Instantly share code, notes, and snippets.

@marvin
Created November 18, 2011 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marvin/1375897 to your computer and use it in GitHub Desktop.
Save marvin/1375897 to your computer and use it in GitHub Desktop.
edit dialog
// new account form
$(function() {
$('.account-edit-dialog-form').dialog({ autoOpen: false })
$( ".account-edit-dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 500,
modal: true,
draggable: false,
resizable: false,
buttons: {
"Update Account": function() {
$.post(".", {
name: $form.find('#id_name').val(),
description: $form.find('#id_description').val(),
organizationtype: $form.find('#id_organizationtype').val(),
branchetype: $form.find('#id_branchetype').val(),
lead: $form.find('#id_lead').val(),
leadsource: $form.find('#id_leadsource').val(),
assigned: $form.find('#id_assigned').val(),
account_id:$("#account_id").val()
},
function(data){
if(data.status =="success"){
$('.account-edit-dialog-form').dialog('destroy').remove();
$.showMessage(data.data);
setTimeout("$.pjax({url: '',container: '#middle'})",100);
} else {
if (data.status == "error") {
$('.account-edit-dialog-form').append(data.data);
}
}
}, "json");
},
Abbrechen: function() {
$('.account-edit-dialog-form').dialog( "close" );
}
},
close: function() {
$('form :input').val("");
}
});
$('#account-edit').on("click", function() {
$( ".account-edit-dialog-form" ).dialog( "open" );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment