@@ -306,11 +306,14 @@ function changeTab(tab,target) {
306306 //document.forms[0].next_tab.value = tab;
307307 document.pageForm.next_tab.value = tab;
308308
309- var id = document.pageForm.id.value;
309+ var idel = jQuery('form#pageForm').find('[name="id"]');
310+ var id = null;
311+ if(idel.length > 0) id = idel.val();
310312 if(tabChangeDiscard == 'y') {
311- if(id && (pageFormChanged == false || window.confirm(tabChangeDiscardTxt))) {
313+ if((idel.length < 1 || id) && (pageFormChanged == false || window.confirm(tabChangeDiscardTxt))) {
312314 var next_tab = tab;
313- loadContent(target, {'next_tab': next_tab, 'id': id});
315+ if(id) loadContent(target, {'next_tab': next_tab, 'id': id});
316+ else loadContent(target, {'next_tab': next_tab});
314317 } else {
315318 return false;
316319 }
@@ -320,8 +323,8 @@ function changeTab(tab,target) {
320323 submitForm('pageForm', target);
321324 } else {
322325 var next_tab = tab;
323- var id = document.pageForm.id.value ;
324- loadContent(target, {'next_tab': next_tab, 'id': id });
326+ if(id) loadContent(target, {'next_tab': next_tab, 'id': id}) ;
327+ else loadContent(target, {'next_tab': next_tab});
325328 }
326329 } else {
327330 submitForm('pageForm',target);
0 commit comments