We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

submit form to a new window

skbohler
skbohler asked
on
Medium Priority
239 Views
Last Modified: 2010-04-09
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
Comment
Watch Question

Commented:
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>

Author

Commented:
I want to control the size of the form with javascript, however.

Steve
Commented:
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>

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.