Results 1 to 3 of 3

Thread: Opening New Window Through Links

  1. #1
    Join Date
    Jul 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Opening New Window Through Links

    Hello,

    This is a simple script in which a users selects from a drop down menu a choice which links to a URL.
    Could anyone tell me what and where to put code that tells each choice/url to open a new window??

    Thank you in advance!

    [CODE]
    <form name="Coffee">
    <p><select name="info" size="1">
    <option value="http://www.saeco-usa.com/">Saeco Vienna Plus</option>
    <option value="http://www.rancilio.it/rancilio/index.jsp">Rancilio Silvia</option>
    <option value="http://www.gaggia.com/index.asp">Gaggia Titanium</option>
    </select></p>

    <script language="javascript">
    //This "function" described as go is what makes this work

    function go()
    {
    location=document.Coffee.info.
    options[document.Coffee.info.selectedIndex].value
    }

    </script>

    <input type="button" name="test" value="Go!" onClick="go()">

    </form>
    [CODE]

  2. #2
    Join Date
    Dec 2004
    Posts
    177
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default

    it should work if you change this

    Code:
    location=document.Coffee.info.
    options[document.Coffee.info.selectedIndex].value
    to this

    Code:
    window.open(document.Coffee.info.options[document.Coffee.info.selectedIndex].value)
    I think. Let me know if it helps.
    Verzeihung!

  3. #3
    Join Date
    Jul 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes - that did it! Thank you so much for the info!!

Bookmarks

Posting Permissions

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