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

January 24th, 2004, 11:26 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

January 25th, 2004, 02:07 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,697
Thanks: 0
Thanked 1 Time in 1 Post
|
|
<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
:::::::::::::::::::::::::::::::::
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |