Popup windows from Dropdown box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Hubling

    Popup windows from Dropdown box

    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.

  • kaeli

    #2
    Re: Popup windows from Dropdown box

    In article <q9hlf01gk1h07i 9hfal46ocpstr02 e7ic9@4ax.com>, ian@hubling.com
    enlightened us with...[color=blue]
    >
    > 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).
    >[/color]

    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="javas cript" type="text/javascript">
    var p_window=null;
    function popWindow(actio n)
    {
    if (action == "0") return;
    p_window = window.open(act ion,"Sample","h eight=300,width =
    300,scrollbars= yes,resizable=y es");
    p_window.focus( );
    }
    </script>
    </head>
    <body>
    <form name="f1">
    <select name="s1" onChange="popWi ndow(this.optio ns
    [this.selectedIn dex].value)">
    <option value="0">-- Choose One --</option>
    <option value="page1.ht ml">Sample 1</option>
    <option value="page2.ht ml">Sample 2</option>
    <option value="page3.ht ml">Sample 3</option>
    <option value="page4.ht ml">Sample 4</option>
    </select>
    </form>
    </body>
    </html>

    --
    --
    ~kaeli~
    Why do people who know the least know it the loudest?



    Comment

    Working...