#4422 closed bug (duplicate)
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: | [email protected]… |
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)
Change History (6)
Changed 14 years ago by
Attachment: | jQueryTest.html added |
---|
comment:1 Changed 14 years ago by
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?
comment:2 Changed 14 years ago by
Also see #4417; it looks like the problem does happen with double quotes too.
comment:3 Changed 13 years ago by
Component: | unfilled → core |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Closing as a dup of #4417.
comment:6 Changed 12 years ago by
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">
Test case HTML