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

submit form to a new window

Hello,

I have a form and I want the results of submitting the form to go appear in a new, resized window.

The form is very basic:

<form action="search.asp" method="post">
<input type="text" size="30" name="keywords">
<input type="submit" value="Search">
</form>

How do I do it?

Thanks in advance,

Steve
0
skbohler
Asked:
skbohler
  • 2
1 Solution
 
hongjunCommented:
you can do this

<form action="search.asp" method="post" target="_blank">
<input type="text" size="30" name="keywords">
<input type="submit" value="Search">
</form>
0
 
skbohlerAuthor Commented:
I want to control the size of the form with javascript, however.

Steve
0
 
hongjunCommented:
Do something like this

<script language=JavaScript>
 function submitForm(form){
   
  // URL is unimportant, so i leave it blank
   window.open ('', 'newWin', config='height=100,width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no')
 
   form.target = "newWin";
   return true;
 }
</script>



<form action="search.asp" method="post" onsubmit="return submitForm(this)">
<input type="text" size="30" name="keywords">
<input type="submit" value="Search">
</form>
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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