User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 360,997 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,436 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1052 | Replies: 1
Reply
Join Date: Jul 2006
Posts: 4
Reputation: DanaNVB is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
DanaNVB DanaNVB is offline Offline
Newbie Poster

Disclaimer Messages

  #1  
Sep 8th, 2006
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!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Disclaimer Messages

  #2  
Sep 8th, 2006
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();" />
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 6:54 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC