![]() |
|
#1
|
|||
|
|||
|
pop up
Hi there
Hope you all are well. I have a few forum on my website, and want to put a confirmation popup on the links on my site I just want a pop that ask the user if he is sure he want to leave this page without submitting the form? with a Yes and No button. the yes button should just send him to the link, and the no button should keep him on the current page. Any help will be great! Root |
| Sponsored Links |
|
#2
|
|||
|
|||
|
HTML Code:
<html> <head> <title>Untitled</title> <script type="text/javascript"> function redirect() { if(confirm('Do you want to leave this page?')) location='url to redirect' } </script> </head> <body> <h1>redirect</h1> <form> The body of your form<br> <input type='button' value='Redirect' onclick="redirect()"> </form> </body> </html> |
|
#3
|
|||
|
|||
|
Thanks for the reply.
I would like "onclick="redirect()"" to be on a link on my site and not a button. And the "location='url to redirect'" must be he location of the link you click on. Thank for the help, I am a new at this, and not very good :-( Root |
|
#4
|
|||
|
|||
|
HTML Code:
<html> <head> <title>Untitled</title> <script type="text/javascript"> function redirect() { if(confirm('Do you want to leave this page?')) return true; else return false; } </script> </head> <body> <a href="http://use4free.co.cc" onclick="return redirect()">Go here</a> </body> </html>
__________________
Free webspace to test php/mysql (keep backup) MySQL Host: sql305.0lx.net >FTP Server: ftp.0lx.net >DB name: 0lx_4217081_testdb FTP/SQL User: 0lx_4217081 >FTP/SQL Password:123456 Website URL: use4free.co.cc (upload to folder "htdocs") Last edited by greatstar00; 10-01-2009 at 02:49 PM. |
|
#5
|
|||
|
|||
|
Thank you.
It's working 100% |
![]() |
| Thread Tools | |
| Display Modes | |
|
|