Popup windows from Dropdown box

Discussion in 'Javascript' started by Ian Hubling, Jul 18, 2004.

  1. Ian Hubling

    Ian Hubling Guest

    I've spent hours adapting various scripts from this forum, but haven't
    been able to make anything work yet. Any help would be appreciated.

    What I want seems simple - which is why I can't believe I can't find
    it in the archives.

    I want to create a simple dropdown - so that selecting any item will
    force a popup window to appear. I need to control the size and
    atributes of the popup window (ie the popup window will show sample
    colors / patterns of a product).

    Thanks.
    Ian Hubling, Jul 18, 2004
    #1
    1. Advertising

  2. Ian Hubling

    kaeli Guest

    In article <>,
    enlightened us with...
    >
    > I want to create a simple dropdown - so that selecting any item will
    > force a popup window to appear. I need to control the size and
    > atributes of the popup window (ie the popup window will show sample
    > colors / patterns of a product).
    >


    Do you want the popup to open a pre-existing page or do you want to
    write to a new document?
    The script will differ greatly depending.

    I'll assume you're opening an already existing document, as that's much
    easier. ;)
    Watch for word-wrapping.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/REC-html40/loose.dtd">
    <html>
    <head>
    <title> New Document </title>

    <script language="javascript" type="text/javascript">
    var p_window=null;
    function popWindow(action)
    {
    if (action == "0") return;
    p_window = window.open(action,"Sample","height=300,width=
    300,scrollbars=yes,resizable=yes");
    p_window.focus();
    }
    </script>
    </head>
    <body>
    <form name="f1">
    <select name="s1" onChange="popWindow(this.options
    [this.selectedIndex].value)">
    <option value="0">-- Choose One --</option>
    <option value="page1.html">Sample 1</option>
    <option value="page2.html">Sample 2</option>
    <option value="page3.html">Sample 3</option>
    <option value="page4.html">Sample 4</option>
    </select>
    </form>
    </body>
    </html>

    --
    --
    ~kaeli~
    Why do people who know the least know it the loudest?
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Jul 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vishnu
    Replies:
    1
    Views:
    1,203
    Patrick.O.Ige
    Mar 25, 2006
  2. Mike
    Replies:
    1
    Views:
    804
  3. Gnarlodious
    Replies:
    4
    Views:
    17,587
    elizas
    May 5, 2010
  4. Replies:
    3
    Views:
    377
    Neredbojias
    May 3, 2006
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    520
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page