SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    form and onchange new window

    Hello, i have a html banner ad which has a form in it, this opens in current window but i need to get it to open in new window.

    From what i have found i need to change the onchange section but i am unsure as to how or what to chage it to. here is code:

    <INPUT TYPE=HIDDEN NAME=catalog VALUE="tackle"><INPUT NAME=query TYPE=TEXT SIZE=17> <INPUT TYPE=SUBMIT VALUE="Go"><input type=hidden name=.autodone value='http://store.yahoo.com/tackle/nsearch.html'>&nbsp;&nbsp;
    <input type=HIDDEN name=catalog value="tackle">
    <select name="Navigation:" onChange="top.location=this.options[this.selectedIndex].value">
    <option value="" selected>Search by Brand


    I should note that teh form has to parts and part for entering text and doing search and the the above which when option is select it goes to URl automatically. I have sorted the 1st bit by doing:


    <FORM METHOD=GET TARGET=BLANK ACTION= >


    many thanks

  2. #2
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: form and onchange new window

    Originally posted by carpman
    I should note that teh form has to parts and part for entering text and doing search and the the above which when option is select it goes to URl automatically. I have sorted the 1st bit by doing:
    I have no idea what this means. Perhaps you could elaborate.

    Regarding your initial question, changing this:

    Code:
    onChange="top.location=this.options[this.selectedIndex].value"
    to this:
    Code:
    onChange="window.open(this.options[this.selectedIndex].value)"
    Will open that address in a new window. However, it will do this each time you change the dropdown, so you could find yourself swamped with popups.

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that did it, thanks

  4. #4
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem.

  5. #5
    SitePoint Enthusiast Bobosse's Avatar
    Join Date
    Feb 2003
    Location
    California
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Makeda,

    Quick question,
    I need the same thing, but, the difference is that I have a top frame "header" and a main frame "main".
    My pulldown menu is located in the "header frame" and I want the "main" frame to reload with the selected var from my pulldown window.
    Right now I have that:
    <select onchange="window.open(this.options[this.selectedIndex].value,'main')">
    in my header.php

    What it does, it does reload with the selected var, but it reloads the full page in main (header+main)...so now I have this on my page:

    header
    header
    main


    Any idea on how to get

    header
    main

    Thanks. Damien


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
  •