Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ General Web Design _ Drop down box opening in new window?

Posted by: mzymblo Sep 29 2010, 12:15 PM

Hi all! What I would to achieve is for the drop list menu to open its links on the same page without opening another window. I load the below page using an inline frame I've listed the code below; thanks so much in advance for the help I have no idea what I'm doing wrong!

==========================================inline frame============================================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>

<iframe id="I1" border="0" frameborder="0" name="I1" scrolling="no" src="http://hildebrandtlc.org/centers/centermain.html" style="width: 515px; height: 630px">Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>

</body>

</html>


=====================================================main page============================================

<head>
<style type="text/css">
.style1 {
background-image: url('http://hildebrandtlc.org/centers/globaljpg/scroll2.gif');
}
</style>
</head>

<table class="style1" style="width: 525; height: 640">
<tr>
<td> </td>
</tr>
</table>
<div id="zipcodelocate" style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 135px; top: 180px">
<script src="http://live.zipcodeworld.com/script/storelocator.js"></script>
<table style="width: 335px;" border="0" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="width: 158px;">ZIP Code<span style="color: #ff0000;">*</span></td>
<td><input id="zip" maxlength="8" size="8" type="text" name="zip" /></td>
</tr>
<tr>
<td style="width: 158px;"><input id="chkRange" value="on" checked="true" type="checkbox" name="chkRange" />Search within</td>
<td><select id="range" name="range" width="80">
<option>5</option>
<option>10</option>
<option>25</option>
<option selected="true">50</option>
<option>100</option>
<option>250</option>
</select> Miles </td>
</tr>
<tr>
<td style="width: 158px;"><input id="chkRecord" value="on" checked="true" type="checkbox" name="chkRecord" />Centers displayed</td>
<td><select id="record" name="record">
<option>5</option>
<option>10</option>
<option>25</option>
<option>50</option>
<option selected="true">100</option>
<option>250</option>
</select> </td>
</tr>
<tr>
<td style="width: 158px;"><input id="uid" value="1811" type="hidden" name="uid" /></td>
<td><input onclick="return storelocatorv2();" value="Find Centers" type="button" /></td>
</tr>
<tr>
<td style="width: 158px;"></td>
<td></td>
</tr>
</tbody>
</table></div>
<div id="layer1" style="position: absolute; width: 205px; height: 80px; z-index: 2; left: 210px; top: 370px">
<script type="text/javascript">
function MM_jumpMenuGo(objId,targ,restore){ //v9.0
var selObj = null; with (document) {
if (getElementById) selObj = getElementById(objId);
if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0; }
}
</script>
<form id="form" name="form">
<select style="width: 162px;" id="jumpMenu" name="jumpMenu">
<option selected="true">Select a Center</option>
<option value="http://hildebrandtlearningcenters.publishpath.com/albright-early-learning-center">Albright Early Learning Center</option>
</select> <input id="go_button" onclick="MM_jumpMenuGo('jumpMenu','parent',0)" value="Go" type="button" name="go_button" />
</form></div>



Posted by: mzymblo Sep 29 2010, 02:54 PM

***Update*** This opens correctly when the page within the iframe is viewed as a stand alone webapge.

Posted by: Darin McGrew Sep 29 2010, 03:58 PM

Can you provide the URL (address) of a document that demonstrates the problem?

Posted by: mzymblo Sep 30 2010, 07:44 AM

QUOTE(Darin McGrew @ Sep 29 2010, 04:58 PM) *

Can you provide the URL (address) of a document that demonstrates the problem?


http://hildebrandtlearningcenters.publishpath.com/centers

It seems to work in Chrome, Thanks for the reply =)

Posted by: Christian J Sep 30 2010, 08:26 AM

When I use the menu it opens http://hildebrandtlearningcenters.publishpath.com/albright-early-learning-center in the parent window --isn't that what you want?

Posted by: Darin McGrew Sep 30 2010, 12:22 PM

In what browser(s) do you see the problem?

Posted by: SaraSHarner Oct 7 2010, 06:37 PM

I dont see the problem, it opens ok in my browser, and it's firefox 3.6.10

Posted by: wgabrie Oct 8 2010, 08:12 PM

From what I can tell, mzymblo has a Javascript that links to a new page. However, he/she is dealing with a page within a page.

The outer web page is just an empty wrapper containing an iframe. The iframe contains the redirect script. This causes, and I'm just guessing here that, some web browsers redirect the outer page while others just redirect the inner iframe box to the new location.

Perhaps the Javascript needs take into account iframe awareness to set the desired outcome instead of leaving it up to the browser what to do?

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)