problem with dialog form

problem with dialog form

hello,

i have a dialog from with 4 butons (save,delete,update and cancel) like this:

  1. var dialog = $('<div id="frm"></div>')
  2.     .dialog({
  3.         autoOpen: false,
  4.         modal: true,
  5.         closeOnEscape: true,
  6.         width: 450,
  7.         height: 300,
  8.         zIndex: 15000,
  9.         buttons: {                   
  10.             save: function() {   
  11.                 var a = $("#a").val();
  12.                 var b = $("#b").val();   
  13.                 var c = $("#c").val();   
  14.                 var date = $(".date").val();               
  15.            
  16.                 insert(a,b,c,date);                   
  17.             },
  18.             update:function() {
  19.                 var a = $("#a").val();
  20.                 var b = $("#b").val();   
  21.                 var c = $("#c").val();   
  22.                 var date = $(".date").val();               
  23.                                            
  24.                 console.log(a+b);
  25.                 console.log(date);
  26.                 console.log(c);
  27.                
  28.                 update(a,b,c,date);       
  29.             },
  30.             delete:function() {
  31.                 var a = $("#a").val();
  32.                 var b = $("#b").val();   
  33.                 var c = $("#c").val();   
  34.                 var date = $(".date").val();
  35.                
  36.                 delete(a,b,c,date);       
  37.             },
  38.             Cancel: function() {
  39.                 dialog.dialog("close");
  40.             }
  41.         },
  42.         title: 'nothing'
  43.     });
this goes right but now i want to do that whit 2 dialog form. one with save and cancel buttons and other with update/delete buttons.

if i create two dialogs i can create news items but when i try to edit or delete one item, console.log(c); is an empty string but there is a value for it.and the values for a and b are the old values

if with one dialog goes right because goes wrong so?

i can undestand it....