Do you want to abandon the purchase? bottom doesn't work
Posted: Mon Aug 11, 2008 12:48 pm
Hi, I am new in PHP codes, and now I am editing a web page. What I see is that when I try to return to a previous web page, I receive a message “Do you want to abandon the purchase?” and also I see the bottoms “Ok’ & “CANCEL”. But when I press “CANCEL”, the page is not abandoned but reloaded and puts the default options again.
How to make it to not reload the page and remains with the options I made, if I press CANCEL?
The code I see is:
<script language="javascript" type="text/javascript">
wend = "usr";
snow = 0;
frmurl = window.location;
window.onunload = endform;
function endform() {
if (wend == "usr") {
sure = confirm("¿Do you want to abandon the pruchase?");
if (sure == false) {
window.location = frmurl;
}
} else {
if (snow == 1) {
document.negfrm.submit();
}
}
}
</script>
Thanks!
How to make it to not reload the page and remains with the options I made, if I press CANCEL?
The code I see is:
<script language="javascript" type="text/javascript">
wend = "usr";
snow = 0;
frmurl = window.location;
window.onunload = endform;
function endform() {
if (wend == "usr") {
sure = confirm("¿Do you want to abandon the pruchase?");
if (sure == false) {
window.location = frmurl;
}
} else {
if (snow == 1) {
document.negfrm.submit();
}
}
}
</script>
Thanks!