
I always knew that you could make a link open up in a new window by adding target=”_blank” to an a tag. However I recently learned that this also works for forms and allows you to designate a form to submit in a new window. This is a useful technique to use in cases where you want your visitors to submit a form where the action is on another website, but at the same time you would like to keep your visitors active on your current site.
Here is how you would do that:
1 2 3 4 5 |
<form action="http://www.somesite.com/formhandler" method="post" target="_blank"> <-- form goes here --> </form> |
The target=”_blank” method is technically deprecated but it is simple, effective and still widely used.