DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Disclaimer Messages (http://www.daniweb.com/forums/thread54565.html)

DanaNVB Sep 8th, 2006 1:11 pm
Disclaimer Messages
 
I'm new to Javascript and could use a bit of advice. I''m looking for a simple way to call a Disclaimer message on a link outside our site.. ... I have tried using the confirm mesage but it still goes to the outside link when someone selects cancel. Can anyone share with me a simple script to do such a thing.

link to another site .....shows disclaimer with option to continue to link or cancel and return to previous page.

Any help is appreciated.

THANK YOU!

tgreer Sep 8th, 2006 2:15 pm
Re: Disclaimer Messages
 
Research JavaScript's "return" keyword. If the user clicks cancel, you want to "return false" from your procedure, which will cancel the default action and/or exit the script.

So, you have a "submit" button. You code the "onclick" event handler, to a function which issues a confirm. If the user presses "Cancel", you return a "false" which cancels the submit.

<input type="submit" onclick="return myConfirmFunc();" />


All times are GMT -4. The time now is 11:49 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC