#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    29
    Rep Power
    0

    Question loading pages with javascript?


    Hi

    I have a frame splitting the broswer into two columns, left side contains the menu and the right side the content.

    In the menu, I have choice to select a client (onChange, javascript submits the form and the new client get loaded in the left pane).

    However, I want to at the same time replace the right hand frame document with blank.html.

    Thanks for your help.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    20
    parent.frameName.location='blank.html'

    e.g.
    Code:
    <form name="menu" method="post" action="">
      <select name="select" onchange="location=document.menu.select.options[document.menu.select.selectedIndex].value; parent.rightFrame.location='http://www.lycos.com'">
        <option selected>Select URL</option>
        <option value="http://www.google.com">Link1</option>
        <option value="http://www.yahoo.com">Link2</option>
      </select>
    </form>
  4. #3
  5. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    <html>
    <head>
    <title>untitled</title>
    </head>
    <body>
    <form>
    <select onchange="self.location=options[selectedIndex].value;
    top.content.location='blank.html'">
    <option selected="selected">Select Client</option>
    <option value="fatclient.htm">Fat Client</option>
    <option value="thinclient.htm">Thin Client</option>
    <option value="serverclient.htm">Server Client</option>
    </select>
    </form>
    </body>
    </html>

    ...where <frame name="content" .........>
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    29
    Rep Power
    0
    Thanks for the answer.

    My little brain got around to it yesterday and I just used a function which does the following:

    function changeCorporate() {
    document.forms[0].submit();
    parent.frames[1].location.href='blank.html';
    }

    Because the form submission gives me the clientID with which the left menu changes and each time we load a new client I wanted to clear up the right hand side.

IMN logo majestic logo threadwatch logo seochat tools logo