p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Web Programming > HTML > HTML Code Clinic
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 24th, 2004, 11:26 PM
Authorized User
Points: 391, Level: 6
Points: 391, Level: 6 Points: 391, Level: 6 Points: 391, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old January 25th, 2004, 02:07 AM
richard.york's Avatar
Wrox Author
Points: 5,386, Level: 31
Points: 5,386, Level: 31 Points: 5,386, Level: 31 Points: 5,386, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,697
Thanks: 0
Thanked 1 Time in 1 Post
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
:::::::::::::::::::::::::::::::::
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript confirm box with just an 'OK' button crmpicco Javascript How-To 26 June 24th, 2008 09: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 06:49 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc