|
-
Jun 1st, 2012, 11:22 AM
#1
Thread Starter
Addicted Member
Target Blank
I was testing the following code:
<form id="test" action="mypage.php" method="post" target="_blank">
<input type="hidden" value="hello" name="myvar">
</form>
Just before the </form>, if i add <input type="submit">, mypage.php opens normally in a new tab. Instead of the submit button, if i do it using js document.getElementById('test').submit(), mypage.php opens in a new window and not in a new tab. Why is that happening? Can i make .submit() open the page in a new tab?
-
Jun 1st, 2012, 12:06 PM
#2
Re: Target Blank
In general you have no control over what "_blank" does; it's dependent on the browser and the user's settings. I would likewise also assume that the difference between those two methods is browser-related; have you tried checking this in different browsers?
You could try having your Javascript execute a click on the submit button (rather than a direct submit()) and see if that makes a difference.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|