submit form to a new window

Posted on 2006-04-07
Last Modified: 2010-04-09

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

How do I do it?

Thanks in advance,

Question by:skbohler
    LVL 33

    Expert Comment

    you can do this

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

    Author Comment

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

    LVL 33

    Accepted Solution

    Do something like this

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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now