javascript help

  woody147 13:27 12 May 04
Locked

I'm trying to use a dropdown listbox, which will open the selected page, for a website i'm working on. I have the basic HTML/javascript code structure working ok (below), but the problem is that the target pages are opening up in a frameset and, as i'm no expert, i'm not sure how to alter the javascript to break out of this, so that they open up as the top frame. Can anyone help? much appreciated!


FORM name="guideform">
SELECT name="guidelinks">
OPTION SELECTED value="..//page1.html">Page 1
OPTION value="">Page2
/SELECT>
  
INPUT type="button" name="go" value="Go!" onClick="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
/FORM>

  ScanJet 21:42 12 May 04

Are you looking for the page selected to open up in a new window of its own, on top without any frames?

I am no expert mind but this should work:

function openup()
d=document.guideform.guidelinks.selectedIndex.value;
{newwin=window.open(d+".html","newwin","toolbar=yes,status=yes,width=630,height=500")}

Adjust options to suit yourself + call the function from onclick

  ScanJet 21:52 12 May 04

Are you looking for the page selected to open up in a new window of its own, on top without any frames?
I am no expert mind but this should work (hopefully the correct version!!):

function openup(){ d=document.guideform.guidelinks.selectedIndex.value;newwin=window.open(d+".html","newwin","toolbar=yes,status=yes,width=630,height=500")}

Adjust options to suit yourself + call the function from onclick

  woody147 09:14 13 May 04

thanks Scanjet, it's not quite what i'm trying to do though. I don't want a completely new window to open up. The website normally uses a frameset though, and i want is to break out of this, so that it opens up in the same window, but without the frames.

  woody147 09:28 13 May 04

no problem, think I have fixed it now. All it took was to change the 'window.location' bit to 'parent.window.location'. goddam javascript and their DOM, think i need to purchase a book.
:-)
thanks again for helping scanjet.

This thread is now locked and can not be replied to.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…