Home » Tutorials » HTML5/CSS3 » Open HTML form in new Window/Tab after submit

Open HTML form in new Window/Tab after submit

target blank wallpaper

Opening HTML form in new tab after submitted is easier than you expect. We use the target=”_blank” attribute, the same way as making a link open in new tab.

<form action="someaction.php" method="post" target="_blank">
    ...
</form>
The target attribute is deprecated in HTML 4.01, but still supported in HTML5.

Opening HTML form in new Window/Tab by using jQuery

Here is an alternative way for opening form in new tab by using jQuery in case you don’t like the first way. Paste this code under the form in your HTML.

<script type="text/javascript">
$("form").submit(function() {
$("form").attr('target', '_blank');
return true;
});
</script>

And don’t forget to include the jQuery library in your head section.

Opening HTML form in new tab after submitted is easier than you expect. We use the target="_blank" attribute, the same way as making a link open in new tab. &lt;form action="someaction.php" method="post" target="_blank"&gt; ... &lt;/form&gt; The target attribute is deprecated in HTML 4.01, but still supported in&hellip;

Review Overview

0%

User Rating: 3.64 ( 6 votes)
0

About Georgi Dyulgerov

Georgi Dyulgerov

Founder of fTutorials.com - the website aiming to keep you in touch with the latest technologies in the brand. Also a Freelance web developer.

Check Also

Change placeholder color

Style HTML5 Placeholder with CSS

In the previous tutorial, I showed you how to create a responsive HTML5 Mail Form. ...

One comment

  1. I found your blog site and book-marked it right away. What
    a fantastic read and that I can’t wait to see your new stuff shortly!

Leave a Reply

Your email address will not be published. Required fields are marked *


Loading Facebook Comments ...