user4486345
user4486345

Reputation:

Target=_blank don't work in mozilla and IE

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

Answers (5)

Bogdan Kuštan
Bogdan Kuštan

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

danilonet
danilonet

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:

http://answers.microsoft.com/en-us/ie/forum/ie9-windows_7/intermittent-problems-with-targetblank-in-ie-9/c7e937be-7400-41e9-bf03-14474fbc1832?auth=1

Upvotes: 1

ARUN G
ARUN G

Reputation: 94

This code perfectly working on my mozilla & IE. I think clients need to update the browsers ...

Upvotes: 1

Azlina T
Azlina T

Reputation: 176

try replace target to onclick

onclick="window.open('example.php', 'newwindow', 'width=800, height=600'); return false;" 

Upvotes: 0

brk
brk

Reputation: 50291

Please check by replacing _blank with blank

<form enctype="application/x-www-form-urlencoded" action method="post" target="blank" id="test1">

Check jsfiddle

Upvotes: 0

Related Questions