Code Snippet
Form Submission Opens New Tab/Window
You probably knew that you could force a link into opening a new tab or window with the target="_blank" attribute (deprecated, but universally still supported).
<a href="#" target="_blank">link</a>But you can use the same exact attribute on forms to get the same result:
<form action="#" method="post" target="_blank">
...
</form>
Nice share! so target becomes the action=”url.html”.
And I used to use java script to do this :O Thanks for sharing
A nice feature, but unfortunately, the target attribute has been deprecated.
http://www.w3schools.com/tags/att_form_target.asp
It’s not deprecated.
http://w3fools.com/
so if it is deprecated, what would be the alternative to open a form in a new window?
Great share.. Thanx.. :)
Unfortunately, this is not totally ‘universally supported’ – it seems like if you try to have multiple forms doing this on one page (in a data grid, for example) – submitting one form kills the others so you get nothing on click (so far confirmed on latest webkit (safari 5.1, chrome 13), but the trick still works with Firefox 6)
So if you’re using this on a site with multiple forms, you may wish to take a look at alternatives.
Of course after being all doom & gloom I found the solution – each form must have a unique id attribute in order for this to work in Safari:
This doesn’t work:
but this does:
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.