Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Post the contents of a form to a nwe window

Status
Not open for further replies.

jlawler

Programmer
Feb 26, 2003
14
IE
I have a form that will post it's contents to a jsp (print.jsp)...but I want this jsp to open in a new window...how can I do this ???

<code>
<form name=&quot;frm_print_des&quot; method=&quot;post&quot; action= &quot;<%= support.sTag(&quot;/services/print.jsp&quot;) %>&quot; >

<a cursor=&quot;hand&quot; href=&quot;javascript:SubmitForm('frm_print_des');&quot; onMouseOut=&quot;self.status='';return true;&quot;><img src=&quot;../images/print.gif&quot; ></a>


Then the submitForm function does the following..
function SubmitForm(sForm){document.forms[sForm].submit();
}
 
[tt]<form target=&quot;_blank&quot; name=&quot;frm_print_des&quot; method=&quot;post&quot; action= &quot;<%= support.sTag(&quot;/services/print.jsp&quot;) %>&quot; >[/tt]

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Thanks for that dwarfthrower.....is it possible to specify the dimensions of this window (i.e remove the toolbar, scrollbar etc.) can the window.open method be used.. ??
 
You would have to create the window prior to submitting the form - kinda like a blank &quot;pop-under&quot; advertisement. Do this using window.open() (Don't forget to name the window).

Then you can use that window name as the value of [tt]target[/tt] for the form. Just use some code in either the onsubmit or onclick events to focus the new window.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

AU.gif
Check out Tek-Tips Australia New Zealand forum1155
NZ.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top