Bug Tracker

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#10105 closed bug (worksforme)

IE7 attr "name" for iframe + form target

Reported by: lukasz.zdanikowski@… Owned by: lukasz.zdanikowski@…
Priority: low Milestone: None
Component: attributes Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

Create iframe element with jQuery(1.6.2) -without name attribute - and then set name attribute with attr(). If there is form element with target set to name of that iframe, submitting form does not work properly (it opens new window) istead of opening result in that iframe.

I don't add jsfiddle code because it works properly.

It looks like it's because iframe is created with attribute submitName="something" istead name="something"

(see also ticket #8418)

Change History (7)

comment:1 Changed 8 years ago by addyosmani

Component: unfiledattributes
Owner: set to lukasz.zdanikowski@…
Priority: undecidedlow
Status: newpending

Thanks for submitting a bug report, but we'll need some form of test case to reproduce this - either on jsFiddle or an uploaded file (ideally the former, but I read your note regarding it working fine there). Please also ensure you test with jQuery git/edge to ensure its broken there too.

comment:2 Changed 8 years ago by lukasz.zdanikowski

simple test case https://github.com/henry150/jquery-jquery_ie7_iframe_form_target

Click lower button and everything is as expected but when you click first button another window is opened.

comment:3 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:4 in reply to:  3 Changed 7 years ago by lukasz.zdanikowski

Replying to trac-o-bot: hmmm I've included test case in comment 2

comment:5 Changed 7 years ago by ajpiano

Resolution: invalid
Status: closedreopened

comment:6 Changed 7 years ago by timmywil

Resolution: worksforme
Status: reopenedclosed

I've added your code here to test and it seems to work fine: http://jsfiddle.net/timmywil/PBUBV/1/show

comment:7 in reply to:  6 Changed 7 years ago by lukasz.zdanikowski

Replying to timmywil:

I've added your code here to test and it seems to work fine: http://jsfiddle.net/timmywil/PBUBV/1/show

You'r right :-) at jsfiddle it works properly - as I wrote in description.

From what i know now case with:

$('<iframe></iframe>').attr({'name' : 'iframe1'});

can't be solved because in IE7 it's not possible to add name attribute after creating node, that's why submitName attribute is set. But the case with:

$('<iframe></iframe>', {'name': 'iframe4'});

can be solved by firstly creating string

<iframe name='iframe4'></iframe>

and creating node from that html string. But it looks like jQ does the same in both cases. Firstly it creates node and then attributes are set.

Note: See TracTickets for help on using tickets.