Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Dropdown menu

  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dropdown menu

    Can somebody tell me how to do a Dropdown menu with button to click efter your chooise, but when you click the button a new window popup, WITHOUT scroller,menu e.tc!!

    Please help, thanks

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this

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

    <script language="javascript">

    function go(){

    var url=document.forms[0].urlSelect.options[document.forms[0].urlSelect.selectedIndex].value

    window.open(url,"newWindow","scroll=no,menuba=no,status=no")

    }

    </script>

    <form>
    <select name="urlSelect">
    <option value="">Choose A Page
    <option value="http://www.acjavascripts.com">ACJavascripts
    <option value="http://www.wsabastract.com">Javascript Kit
    <option value="http://www.java-scripts.net">Java-scripts.net
    </select>
    <input type="button" value=" - GO - " onclick="go()">
    </form>

    ---------

    Hope this helps
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Location
    TN
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, the button doesn't necessarily have anything to do with a dropdown. To just go somewhere in a new (plain) window with a button you can do this:

    <input type="button" value=" Go "
    onclick="open('page.html',
    '','width=300,height=200,scrollbars,resizable')">

    Set the width and height as needed, remove scrollbars and resizable options as needed.

    If you want the selection from the dropdown to pick the page to load into the new window you can do this:

    <select name="s1">
    <option value="/index.html">Home</option>
    <option value="http://somewhere.com">Somewhere</option>
    <option value="/deals/good.html">Good Deals</option>
    </select>
    <input type="button" value=" Go "
    onclick="w1=open(s1.options[s1.selectedIndex].value,
    '','width=300,height=200,scrollbars,resizable');
    w1.focus()">

    Note that the dropdown is named "s1" and that this same name occurs in 2 places in the button 'onclick', so the name must agree in those 3 places if you change it.


  •  

    Posting Permissions

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