Results 1 to 3 of 3

Thread: Frame linking via code - Please help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    258

    Frame linking via code - Please help

    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.

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    Try parent.document.main.location.href

  3. #3
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    In fact you might need parent.document.main.document.location.href for some browsers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width