PDA

Click to See Complete Forum and Search --> : Frame linking via code - Please help


LucaUWF
Jul 11th, 2003, 06:08 PM
I'm having to redesign my website to accomodate varying screen resolutions.

As such, I've changed to a Three Frame Layout that is a stencil from MS Frontpage. The Stencil is the header contents.

The three frames are named: contents, header and main.

My menu is a series of combo boxes that when clicked will load a new page.

My old webpage was a document with an iframe called main. When the combo box was clicked the new page loaded into the frame... worked fine.

With my new site however I cannot get the new page to load in main. The code that worked before is below:

------------------
<select name=select4 style="background-color:#000000;font size:10; font-family:Tahoma;color:white;width=120"

onChange='if (this.options[this.selectedIndex].value!="") {document.main.location.href=this.options[this.selectedIndex].value}else{this.selectedIndex=0};'>

<option selected>MAIN</option>
<option>----------</option>
<option value="http://www.domain.com/Main2.htm" target="main">Main Page</option>

<option value="http://www.domain.com/News.htm" target="main">News</option>

<option value="http://www.domain.com/Products/product_list.php" target="main">Current Products</option>

<option value="http://www.domain.com/Site_Registration/login_entry.php" target="main">Member Login</option>

</select>

------------------------

I know the problem is selecting the right document but don't know the correct syntax/code.

Any help would be very appreciated at this time as I've spent well over four hours trying to figure it out.

Thanks guys n girls.

dj4uk
Jul 18th, 2003, 06:57 AM
Try parent.document.main.location.href

dj4uk
Jul 18th, 2003, 06:58 AM
In fact you might need parent.document.main.document.location.href for some browsers.