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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form button in new window

Status
Not open for further replies.

iluvperl

Programmer
Joined
Jan 22, 2006
Messages
107
I was looking how to get a form to launch a new window and found this working code.

Code:
<form action="" target="newFormWindow" onsubmit="window.open('hi there', this.target, 'width=685,height=500')">

What is the first brackets I used for 'hi there' used for? And what about this.target? When my window launches, it launches a page that doesn't exist and then redirects to my script. I am sort of confused at why it's doing that.
 
Your code isn't "working code" at all. All it does is open a new window, it doesn't submit the form at all so all values inputted to the form will be lost. All you have to do to submit a form to a new window is supply a value of _new to the target attribute:

Code:
<form action="" target="[!]_new[/!]">

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
Actually, the code IS working code. It processes my form data and everything. So what does that first "" mean? Why is it redirecting before it gets to the form output?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top