• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

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??

  • 2
1 Solution
Put this between <head> and </head> at the top of the page:

          function search() {
                  newwindow = open("", "newwindow", "width=300,height=100,status=no,toolbar=no,menubar=no,scrollbars=no");

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()">

Hope this helps.
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.
th_c_manAuthor Commented:
Ok. I've got what i wanted to work....

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

Thanx anyway,

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.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now