[jQuery] appendTo() only appending the first element found

[jQuery] appendTo() only appending the first element found


I have some very simple code that takes form elements found elsewhere
on the page and is *supposed* to add them to a form when it is
submitted. However, every single time jQuery 1.2.6 only adds the very
first one it finds.
Here is my code:
__________________________________________________________________
<form action="/shopping_cart.php" method="post" name="mainform">
    <input type="hidden" name="quantity" value="1" />
</form>
Item 1 <input id="extra_items" type="checkbox" value="145357"
name="additem[0]"/>
Item 2 <input id="extra_items" type="checkbox" value="649681"
name="additem[1]"/>
Item 3 <input id="extra_items" type="checkbox" value="34385"
name="additem[2]"/>
function submitAddItems() {
    $('#extra_items').clone().appendTo('form[name=mainform]');
    $('form[name=mainform]').submit();
}
__________________________________________________________________
Interestingly enough, if I check the length this way:
window.console.log($("input[name^='additem']").length);
...I get length of 4, even though there are only 3.
If I check the length this way:
window.console.log($('#extra_items').length);
...I get length of 1, even though there are actually 3 on the page.
I also just tried: $('#extra_items').appendTo('form[name=mainform]');
...but that yields the same results as having clone() in there. Just
one gets added.
What am I doing wrong here?
BTW, I have a good reason for doing this. Several other forms with
differing purposes on the page would otherwise overlap which causes
problems in IE 6.