Skip to main content

Bug Tracker

Side navigation

#6206 closed bug (worksforme)

Opened March 02, 2010 08:43PM UTC

Closed March 02, 2010 09:10PM UTC

.html() Form

Reported by: liaodrake Owned by:
Priority: Milestone: 1.4
Component: manipulation Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

problem with jQuery adding <form> tags to DOM.

eg:

$('#obj').html("<form ...><input ...></form>");

in this example, all the elements with in the form tags will be added to the DOM, but the form tags themselves will be skipped.

expects:

<div id='obj'>

<form ...><input ...></form>

</div>

results:

<div id='obj'>

<input ...>

</div>

Attachments (0)
Change History (3)

Changed March 02, 2010 08:50PM UTC by john comment:1

component: unfiledmanipulation
resolution: → worksforme
status: newclosed

Do you have an example? There was an issue with inserting forms in 1.4 that was fixed in later versions of jQuery (should be working in 1.4.2).

Changed March 02, 2010 08:59PM UTC by liaodrake comment:2

resolution: worksforme
status: closedreopened

_Me.html("\\n<div class='UploaderUserInput'>\\n\\t<div id='Uploader1' class='UploaderUserInputGroup'>\\n\\t\\t<div class='UploaderIcon'><img src='" + opts.emptyIcon + "' /></div>\\n\\t\\t<div class='UploaderFormInputElements'>\\n\\t\\t\\t" + opts.additionalField + "\\n\\t\\t\\t<form action='' method='post' enctype='multipart/form-data'>\\n\\t\\t\\t\\t<div class='FileName'><label for='" + opts.fileFieldName + "'>File: </label><input type='file' name='" + opts.fileFieldName + "' /></div>\\n\\t\\t\\t\\t<div class='btnUpload'><button name='btnUpload'>Upload</button></div>\\n\\t\\t\\t</form>\\n\\t\\t</div>\\n\\t</div>\\n</div>\\n");

1.4.2 returns:

<div class="UploaderUserInput">

<div id="Uploader1" class="UploaderUserInputGroup">

<div class="UploaderIcon"><img src="/core/images/icons/attach_paperclip.png"></div>

<div class="UploaderFormInputElements">

<div class="FileTitle"><label for="pdfTitle">Title: </label><input name="pdfTitle" type="text"></div>

<div class="FileName"><label for="EquipmentPDFFileName">File: </label><input name="EquipmentPDFFileName" type="file"></div>

<div class="btnUpload"><button name="btnUpload">Upload</button></div> </div>

</div>

</div>

1.3.4 returns:

<div class="UploaderUserInput">

<div id="Uploader1" class="UploaderUserInputGroup">

<div class="UploaderIcon"><img src="/core/images/icons/attach_paperclip.png"></div>

<div class="UploaderFormInputElements">

<div class="FileTitle"><label for="pdfTitle">Title: </label><input name="pdfTitle" type="text"></div>

<form action="" method="post" enctype="multipart/form-data">

<div class="FileName"><label for="EquipmentPDFFileName">File: </label><input name="EquipmentPDFFileName" type="file"></div>

<div class="btnUpload"><button name="btnUpload">Upload</button></div>

</form>

</div>

</div>

</div>

Changed March 02, 2010 09:10PM UTC by john comment:3

resolution: → worksforme
status: reopenedclosed

I can't duplicate this, I created the test case and the form is created just fine:

http://dev.jquery.com/~john/ticket/6206/