PDA

View Full Version : Main Window loads the same content as the pop open window


gregw
03-25-2003, 06:20 AM
I'm trying to open a small window after clicking on a image but the same text content is loaded in the main window also.

Here's a sample of the code...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Ticket Selection</title>
<script type="text/javascript" language="javascript">

var iBoxmax = 10; //maximum number allowed

function boxLimit(oLastbox, iMax) {
var oEl, e = 0, iChecked = 0, f = document.forms[0];
var sMsg = '\nHey wait a minute! You have picked more than 1 game.\n\n';
sMsg += 'Please choose only 10 dates. Thanks.\n\n';
while (oEl = f.elements[e++]) if (oEl.type == 'checkbox' && oEl.checked) ++iChecked;
if (iChecked > iMax) {
alert(sMsg);
return (oLastbox.checked = false);
}
}

</script>
</head>
<body>

<!--Start of the game selection code-->

<center><font face="arial black">Pick Your Games</font></center><p>
<table border="1">
<tr>
<td><font face="arial" size="2">APRIL<p>

<form name="choice" method=post ENCTYPE = "text/plain" action="mailto:gwolfe@wi.rr.com">

<input type="checkbox" name="choice" value="4/14" onclick="if (this.checked)boxLimit(this,iBoxmax)"> Monday, April 14th vs. STL at 7:05pm <a href="414.html"><img src="../Brewers/promo.gif" width="13" height="13" border="0" alt="promo.gif - 55 Bytes" onClick="window.open('414.html','Popup_Window','toolbar=no,location=no,directories=no,status=no,menubar=no,sc rollbars=no,resizable=yes,copyhistory=no,width=250,height=200')"></a><br>

Thanks for your help!

Borgtex
03-25-2003, 11:13 AM
you're opening the page twice:

<a href="414.html"> - opens it in the current window

onClick="window.open('414. html',... - another window.

The correct would be:

<a href="414.html" onClick="window.open(this.href,'Popup_Window','toolbar=no,location=no,direc
tories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=250,height=200');ret urn false">

and remove the onClick event for the img tag