ron4721
asked on
If user closes browser window, display alert to ask if user wants to view optional reports (ok/cancel)
Hi,
I have an order confirmation page. On this page I want to be able to do the following:
If a user closes the browser window, I would like an alert to appear that asks "do you wish to purchase optional reports" with an "OK" and "Cancel" button.
If they click "OK", they go to the optional reports page. If they click "Cancel", then the browser window can close as they intended to do.
Please help! Thanks!
-R.
I have an order confirmation page. On this page I want to be able to do the following:
If a user closes the browser window, I would like an alert to appear that asks "do you wish to purchase optional reports" with an "OK" and "Cancel" button.
If they click "OK", they go to the optional reports page. If they click "Cancel", then the browser window can close as they intended to do.
Please help! Thanks!
-R.
ASKER
This seems to be almost what I need. However, when i click "OK", it will close the window and i can't see the new page.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi leakim971,
this looks about right! ;) only thing is it is working the opposite way i would like.
If they choose "ok", they go to the google link, and if they choose "cancel", the browser window closes.
thanks,
-R.
p.s. thanks for the warning about changing the text of the buttons ;)
this looks about right! ;) only thing is it is working the opposite way i would like.
If they choose "ok", they go to the google link, and if they choose "cancel", the browser window closes.
thanks,
-R.
p.s. thanks for the warning about changing the text of the buttons ;)
>Click \"Cancel\" button if you wish to purchase optional reports
That why I change your text : Click \"Cancel\" button if you wish to purchase optional reports
Good article to read : http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript
That why I change your text : Click \"Cancel\" button if you wish to purchase optional reports
Good article to read : http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript
ASKER
Thanks leakim971,
Thanks for your help and for the explanation and link to the article. You answered all my questions and more!! I really appreciate your help!
-R.
Thanks for your help and for the explanation and link to the article. You answered all my questions and more!! I really appreciate your help!
-R.
Thank you very much for the points! Have a nice week-end!
Open in new window