p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   HTML Code Clinic (http://p2p.wrox.com/forumdisplay.php?f=90)
-   -   Confirm alert box - need help, Please! (http://p2p.wrox.com/showthread.php?t=8558)

larry January 24th, 2004 11:26 PM

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 [:I]

<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

richard.york January 25th, 2004 02:07 AM

<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
:::::::::::::::::::::::::::::::::


All times are GMT -4. The time now is 11:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.