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!

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();" />
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.