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!
Do you want to abandon the purchase? bottom doesn't work
Moderator: General Moderators
Re: Do you want to abandon the purchase? bottom doesn't work
1. This is not PHP code, it is Javascript
2. Please enclose code within "code" tags so that it is easier to read
3. Change this line:
to
2. Please enclose code within "code" tags so that it is easier to read
3. Change this line:
Code: Select all
window.location = frmurl;Code: Select all
//window.location = frmurl;