jQuery submit form stay in the same tab/window

Viewed 19

So, I automatized a form on a project with jQuery's .submit() function but unfortunately it doesn't perform the submit on the same tab (as if you would click by yourself) - it opens a new tab. How do I perform an automatic .submit() and stay in the same tab?

<form action="someurl" method="post" id="myform">
...
</form>

<script type='text/javascript'>
                jQuery(document).ready(function() {
                        jQuery('#myform').submit();
                    });
</script>
1 Answers

Silly me. The form was generated and it had the property target="_blank" instead of target="_self".

Related