Reputation:
I have a form for submitting and posting result in new tab , my code working fine in Chrome, but when i open my page in Mozilla or IE , it doesn't work , and new tab will not Open.
all i want is to open form submitting in new tab , in common browsers (mozilla,chrome,IE)
Here is my code:
<form enctype="application/x-www-form-urlencoded" action method="post" target="_blank" id="test1">
<input type="text" name="txtUserPrice" id="txtUserPrice" />
<input type="submit" name="btnSubmitForm" value="Buy" />
</form>
i think my problem come from target="_blank"
, Because in chrome, it open new tab. But other browsers (Mozilla and IE) doesn't.
How can i fix this?
One more question:
This problem , cause for different browser rendering or code parsing?
Upvotes: 2
Views: 1672
Reputation: 5577
Try, adding formtarget
attribute to submit button :
<form enctype="application/x-www-form-urlencoded" action method="post" target="_blank" id="test1">
<input type="text" name="txtUserPrice" id="txtUserPrice" />
<input type="submit" formtarget="_blank" name="btnSubmitForm" value="Buy" />
</form>
Upvotes: 0
Reputation: 1795
this is a Known Bug Microsoft Internet Explorer
Some versions of MSIE have a bug which renders anchors using "_blank" inoperative. See "Open In New Window" Does Not Work in Internet Explorer for the patch.
Read more at:
Upvotes: 1
Reputation: 94
This code perfectly working on my mozilla & IE. I think clients need to update the browsers ...
Upvotes: 1
Reputation: 176
try replace target
to onclick
onclick="window.open('example.php', 'newwindow', 'width=800, height=600'); return false;"
Upvotes: 0