S
suryakul
Hi,
i have the following code
cancelVendorButton' : function(el){
el.onclick = function() {
if (!confirm("Are you sure you wish to leave before saving
changes")){
return false;
}
$('action').value="createScreen";
$('vendorForm').submit();
}
}
THE PROBLEM IS THE FORM IS GETTING SUBMITTED BEFORE THE DISPLAY MESSAGE
EVENT IS EXECUTED..SO WHEN I DO THE CANCEL IN THE EVENT I GET A RUN
TIME ERROR..HOW CAN I PREVENT THIS..IS THERE ANY ALTERNATE WAY TO DO
IT..
i previously used the following code
window.onbeforeunload = displayMessage;
and in my js used
function displayMessage(){
mess="Any Unsaved Changes Will Be Lost"
return mess;
}
i have the following code
cancelVendorButton' : function(el){
el.onclick = function() {
if (!confirm("Are you sure you wish to leave before saving
changes")){
return false;
}
$('action').value="createScreen";
$('vendorForm').submit();
}
}
THE PROBLEM IS THE FORM IS GETTING SUBMITTED BEFORE THE DISPLAY MESSAGE
EVENT IS EXECUTED..SO WHEN I DO THE CANCEL IN THE EVENT I GET A RUN
TIME ERROR..HOW CAN I PREVENT THIS..IS THERE ANY ALTERNATE WAY TO DO
IT..
i previously used the following code
window.onbeforeunload = displayMessage;
and in my js used
function displayMessage(){
mess="Any Unsaved Changes Will Be Lost"
return mess;
}