problem with dialog form
problem with dialog form
hello,
i have a dialog from with 4 butons (save,delete,update and cancel) like this:
- var dialog = $('<div id="frm"></div>')
- .dialog({
- autoOpen: false,
- modal: true,
- closeOnEscape: true,
- width: 450,
- height: 300,
- zIndex: 15000,
- buttons: {
- save: function() {
- var a = $("#a").val();
- var b = $("#b").val();
- var c = $("#c").val();
- var date = $(".date").val();
-
- insert(a,b,c,date);
- },
- update:function() {
- var a = $("#a").val();
- var b = $("#b").val();
- var c = $("#c").val();
- var date = $(".date").val();
-
- console.log(a+b);
- console.log(date);
- console.log(c);
-
- update(a,b,c,date);
- },
- delete:function() {
- var a = $("#a").val();
- var b = $("#b").val();
- var c = $("#c").val();
- var date = $(".date").val();
-
- delete(a,b,c,date);
- },
- Cancel: function() {
- dialog.dialog("close");
- }
- },
- title: 'nothing'
- });
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....