form and new window

how can i make a forms results open in a new window? I have a page that i use for my start page, i want to be able to have search engines direct on to it like the yahoo one, and have the search results open in a new window so my page can stay there the whole time without other pages taking that window. how do i do this??

-Daniel
th_c_manAsked:
Who is Participating?
 
jkeeblerConnect With a Mentor Commented:
Put this between <head> and </head> at the top of the page:

     <script>
     <!--
          function search() {
                  newwindow = open("", "newwindow", "width=300,height=100,status=no,toolbar=no,menubar=no,scrollbars=no");
      //-->
     </script>

Then put this in the document (uses Yahoo for an example):

      <form method="GET" action="http://search.yahoo.com/bin/search" target="newwindow">
      <input type="text" name="p" value="" size=18>
      <input type="submit" name="name" onClick="search()">
      </form>

Hope this helps.
0
 
th_c_manAuthor Commented:
SO the key bit there being that I can specify a TARGET for the form results?

Let me try something, and I'll get back.
0
 
th_c_manAuthor Commented:
Ok. I've got what i wanted to work....

All i did was add
TARGET="_blank"
to the <form> tag and now it's ok.

Thanx anyway,

Daniel
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.