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!

on submit, opening new window 1

Status
Not open for further replies.

TheEnigma

Technical User
May 26, 2002
69
US
Hi there,

I have a form set-up on my website so that when someone enters their information it redirects to another page saying thank you. What I would really like to do is have a new window pop up, leaving the old window open. I know how to do this in a normal link easily enough, but not in the submit information. The code below is what I use:

<p align=&quot;center&quot;>
<input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Send message&quot; />
<input type=&quot;hidden&quot; name=&quot;Action&quot; value=&quot;Sendmessage&quot; />
<font color=&quot;#FFFFFF&quot; size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>or</font>
<input name=&quot;reset&quot; type=&quot;reset&quot; value=&quot;Reset Form&quot; />
<input type=&quot;hidden&quot; name=&quot;txtSubject&quot; value=&quot;New Enquiry&quot; />
<input type=&quot;hidden&quot; name=&quot;txtTo&quot; value=&quot;enquiries@email.com.au&quot; />
<input type=&quot;hidden&quot; name=&quot;Redirect&quot; value=&quot;thankyou.htm&quot; />
</p>
</form>

Is anyone able to help me please?
 
How about add a target in the form tag:

<form name=&quot;aForm&quot; target=&quot;_blank&quot; action=&quot;...&quot;>

This will force the form submittion using a new window.
 
Hi there,

Sorry my skills as far as all this goes are quite limited, should the code look like what is below if I do that? I am not quite sure what should go in between the action &quot;..&quot;!?

<p align=&quot;center&quot;>
<input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Send message&quot; />
<input type=&quot;hidden&quot; name=&quot;Action&quot; value=&quot;Sendmessage&quot; />
<font color=&quot;#FFFFFF&quot; size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>or</font>
<input name=&quot;reset&quot; type=&quot;reset&quot; value=&quot;Reset Form&quot; />
<input type=&quot;hidden&quot; name=&quot;txtSubject&quot; value=&quot;New Enquiry&quot; />
<input type=&quot;hidden&quot; name=&quot;txtTo&quot; value=&quot;enquiries@email.com.au&quot; />
<input type=&quot;hidden&quot; name=&quot;Redirect&quot; value=&quot;thankyou.htm&quot; />
</p>
</<form name=&quot;thankyou.htm&quot; target=&quot;_blank&quot; action=&quot;...&quot;>
 
You need to put a form tag around the input field of your form, and set the action (green text below) the URL that this form is submitting to.

<form name=&quot;yourFormName&quot; target=&quot;_blank&quot; action=&quot;#action url#&quot;>
Code:
<input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Send message&quot; />
<input type=&quot;hidden&quot; name=&quot;Action&quot; value=&quot;Sendmessage&quot; />
<font color=&quot;#FFFFFF&quot; size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>or</font> 
<input name=&quot;reset&quot; type=&quot;reset&quot; value=&quot;Reset Form&quot; />
<input type=&quot;hidden&quot; name=&quot;txtSubject&quot; value=&quot;New Enquiry&quot; />
<input type=&quot;hidden&quot; name=&quot;txtTo&quot; value=&quot;enquiries@email.com.au&quot; />
<input type=&quot;hidden&quot; name=&quot;Redirect&quot; value=&quot;thankyou.htm&quot; />
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top