Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10

Thread: Drop Down Boxs

  1. #1
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Hi Guys,

    Web design is new to me I am really a Network Engineer!!....

    Has any one got any ideas why I am unable to get any of these links to open in the mainframe on my index page when selected from my drop down box. They insist on opening a new window..

    I have got this code in the [Head Tags]:

    <script language="JavaScript">
    <!--
    function SelectIt(){
    if (document.Links.Select.options[document.Links.Select.selectedIndex].value != "none"){
    url = document.Links.Select.options[document.Links.Select.selectedIndex].value
    mainFrame=window.open( url ,"_mainFrame_","toolbar=0,location=0,status=1,menu bar=0,scrollbars=1,resizable=1,width=430,height=27 0")}
    }
    //-->


    And this code in the [Body]:

    <form name="Links">
    <div align="center"><center><p>
    <select NAME="Select" onchange="SelectIt()" size="1">
    <option value="none" selected>Team Information </option>
    <option value="Fixt.htm">Fixture List</option>
    <option value="http://www.westendrugby.co.uk">League Table</option>
    <option value="http://www.westendrugby.co.uk">Match Report</option>
    <option value="http://www.westendrugby.co.uk">Player Profile</option>
    </select></p>
    </center></div>
    </form>

    Any help appreciated!!!!
    Thanks Guys


    :cheeky:
    Happy go lucky!!!

  2.  

  3. #2
    Junior Member gazman's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    28
    Member #
    566
    I'm not an expert at this, just pointing out some niggly things...

    <snip>
    ...
    </snip>
    ~GaZ~

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Actually, window.open will open in a new window regardless. What you want is
    Code:
    document.location.href=url;
    in place of the mainframe line.

    (This will open it in the same window.)
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Maybe I'm delusional but this should work, too:
    Code:
    window.location = "http://.../...";
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Thanks Guys for replying....

    Sorry but i am a newby at this... What I am actually trying to do is use the link in the left frame to open up in the main frame.....

    Sorry if that is what you guys have already explained....
    Happy go lucky!!!

  7. #6
    Junior Member gazman's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    28
    Member #
    566
    i think window.location.href is the value of the current URL.

    [edited out]
    ~GaZ~

  8. #7
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Gazman.....

    Thanks!!!!
    Sorry for taking so long to reply.... Got hacked, Screwed Bios and Hard Disk...... Anyhow back now so thanks man...
    Happy go lucky!!!

  9. #8
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Oops!!!! It dont seem to work Gaz..... Got any Ideas..?...
    Cheers Guys
    Happy go lucky!!!

  10. #9
    Junior Member gazman's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    28
    Member #
    566
    Ok tried and tested code. Sorry for all the mistakes in the previous posts. I'll edit them to reduce the total thread size, in a sec.

    <html>
    <head>
    <title>test</title>
    <script language="JavaScript">
    <!--
    function SelectIt(){
    if (document.Links.Select.options[document.Links.Select.selectedIndex].value != "none")
    {
    url = document.Links.Select.options[document.Links.Select.selectedIndex].value;
    window.open(url,"","toolbar=0,location=0,status=1, menubar=0,scrollbars=1,resizable=1,width=430,heigh t=270");
    }
    }
    //-->
    </script>
    </head>

    <body>
    <form name="Links" method="POST" action="nothing.html">
    <div align="center"><p>
    <select NAME="Select" onChange="SelectIt()" size="1">
    <option value="none" selected>Team Information </option>
    <option value="Fixt.htm">Fixture List</option>
    <option value="http://www.westendrugby.co.uk">League Table</option>
    <option value="http://www.westendrugby.co.uk">Match Report</option>
    <option value="http://www.westendrugby.co.uk">Player Profile</option>
    </select></p>
    </div>
    </form>
    </body>
    </html>
    ~GaZ~

  11. #10
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Thanks!!!

    Thanks Gaz.....
    Happy go lucky!!!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:56 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com