Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 24th, 2004, 11:26 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Confirm alert box - need help, Please!


My question is below, but I found the answer so I wanted to post this so no one would waste their time responding. For those that might need the answer some day, here is how you do it:

<script language="javascript">
if (confirm("blah, blah, blah!"))
{
window.location.href="http://www.whatever.com/your_page_name_here.htm";
}
else
{
window.close();
}
</script>

---------------------------------------------------------

I apoogize for cross posting this on two topics but I really need an answer on this tonight if possible, and it's Saturday night at 8:30 PM, and I want this request to hit a couple of topic areas where there might be someone there tonight.††I promise not to make a practice of this

<script language="javascript">

if(confirm("This page is reserved for registered users only.\n\n Click OK to register for your full version of the exams!"))
{
window.location.href="http://www.networkdriven.com/qp/purchase_page_continued_all.htm";
}
else
{
window.location.href=""; †<---- I just want the entire window to close here
}
</script>

The first part of this script does what I want and that is go to the link shown, but the "else" statement, I just want the page to close when the user clickes the Cancel button.

Would you be so kind as to provide the sytax code to do this? I am stumped
__________________
Rudy
Reply With Quote
  #2 (permalink)  
Old January 25th, 2004, 02:07 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 5 Times in 5 Posts
Default

<script language="javascript">

if(confirm("This page is reserved for registered users only.\n\n Click OK to register for your full version of the exams!"))
{
window.location.href="http://www.networkdriven.com/qp/purchase_page_continued_all.htm";
}
else
{
self.close(); <---- I just want the entire window to close here

// or top.close() (topmost frame)
// or parent.close() (parent frame)
// or window.close() no inheritance
}
</script>


: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript confirm box with just an 'OK' button crmpicco Javascript How-To 28 March 12th, 2014 07:44 AM
JavaScript Confirm Box ricespn Classic ASP Basics 1 January 20th, 2007 12:48 AM
R (registered) symbol in a confirm box crmpicco Javascript 9 December 5th, 2005 09:07 AM
change this alert/confirm box crmpicco Javascript How-To 3 March 9th, 2005 01:11 PM
Need help with this confirm alert script, Please! larry Javascript How-To 1 January 26th, 2004 02:42 PM



All times are GMT -4. The time now is 08:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.