Drop-Down box query

Discussion in 'Web Design & Coding' started by onimkron, Jul 15, 2004.

  1. onimkron

    onimkron OSNN Senior Addict

    Messages:
    414
    Just wondering if anyone can help me out on this...

    Code:
    <form action="areas" method="post">
    <select name="opsmenu1" size="5">
    <option value="ih01/demil/fm16/index.htm*_blank">FM16 Area</option>
    <option value="ih01/demil/fm21/index.htm*_blank">FM21 Area</option>
    </select>
    <input TYPE="button" VALUE="GO!" onClick="jump(this.form)">
    </form>
    
    At the moment, it's fine; clicking on a link and selecting 'go' makes it load the selected html page on a different window. What I want to do is make it so that the new window is of a predefined size, possibly with "width" and "height" tags, but I've got no idea on how to do so :confused:

    Any help will be appreciated

    Edit: Ah wait, nevermind, I solved it through the java script code near the <head>. Please disregard this post :eek:
     
  2. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    I would change a bit:

    Code:
    <form name="menu1" method="post" action="">
    <select name="links">
    <option value="ih01/demil/fm16/index.htm*_blank">FM16 Area</option>
    <option value="ih01/demil/fm21/index.htm*_blank">FM21 Area</option>
    </select>
    <input type="button" name="go" value="Go!" onclick="window.open(url, '', 'width=350,height=400,toolbars=no,status=no,scrollbars=yes,resizable=yes')"> 
    <script>
    var url = document.menu1.links.options[document.menu1.links.selectedIndex].value;
    </script>
    </form>
    Obviously you can change the window attributes to your liking, width=350,height=400,toolbars=no,status=no,scrollbars=yes,resizable=yes
     
  3. onimkron

    onimkron OSNN Senior Addict

    Messages:
    414
    Very nice, thanks for that. I opted to change the java script code instead, since that would allow me to use other window sizes for different links, rather than restrict it to those in the drop-down box. For example, _blank for video files, _blankpic for galleries etc, with varying window sizes on pop up.

    Thanks for the code though, would've saved me a lot of time :)