Skip to main content

Bug Tracker

Side navigation

#4422 closed bug (duplicate)

Opened March 25, 2009 10:14PM UTC

Closed August 07, 2009 04:56PM UTC

Last modified April 22, 2011 09:31AM UTC

Clone under IE8 - form with trailing / in action

Reported by: doug316 Owned by:
Priority: minor Milestone:
Component: core Version: 1.2.6
Keywords: ie8 form clone Cc: doug316@gmail.com
Blocked by: Blocking:
Description

IE8 version 8.0.6001.18702

When cloning a form in IE8 with a trailing slash in the action, the form opening tag is incorrectly treated as an open/close tag. Its children are treated as children of the form's parent rather than the form, and the original form close tag is without a matching open.

Using the included code, view the HTML under IE8, and then browse the DOM. Within '#div2 .contents form ' you'll notice that there are no inputs, and that the inputs are children of the parent '.contents'. Compare with #div1.

When I browse the code using IE DebugBar, the quotes on the action do not appear and the trailing slash immediately precedes the closing >.

Remove the trailing slash from the action, and the bug no long occurs.

Attachments (1)
  • jQueryTest.html (0.5 KB) - added by doug316 March 25, 2009 10:14PM UTC.

    Test case HTML

Change History (5)

Changed March 26, 2009 02:09AM UTC by dmethvin comment:1

Oooh, that's a good one.

I don't have IE8 handy on this system...If you dump out

$("#contents").html()
does the form tag look something like this, i.e., with your quotes stripped?

<form class=form1 action=blah/>

As part of another IE workaround, jQuery uses

.html()
in
.clone()
so if the quotes are stripped out by IE it is generating bad HTML.

Does the same thing happen if you use double quotes?

Changed March 26, 2009 02:14AM UTC by dmethvin comment:2

Also see #4417; it looks like the problem does happen with double quotes too.

Changed August 07, 2009 04:56PM UTC by dmethvin comment:3

component: unfilledcore
resolution: → duplicate
status: newclosed

Closing as a dup of #4417.

Changed January 22, 2010 07:10AM UTC by vishvananda comment:4

Stumbled across this same problem. It still exists in 1.4

Changed April 22, 2011 09:31AM UTC by anonymous comment:5

source:

<div id="dialog_template" style="display: none;">

<form action="/restaurants/" method="POST">

<input name="query_reserve" value="true" type="hidden"/>

<input name="address" value="" type="hidden"/>

<input name="reserve" value="" type="hidden"/>

...

</form>

</div>

code:

dialog_template = jQuery("#dialog_template").html();

jQuery("#dialog_template").remove();

result in ie8:

<FORM method=post action=/restaurants></FORM><INPUT name=query_reserve value=true type=hidden> <INPUT name=address type=hidden> ... </FORM>

bug fixes:

change action to <form action="/restaurants" method="POST">