views:

37

answers:

1
+1  A: 

I think you need to take extra care for checkbox, it may you need to add the line

inputElement.attr('checked',this.attr('checked'));

Thanks

Muhit
I believe that would add the checked attribute to the inputElements, which I could see value in. But wouldn't I need to insure that line only occurs if the element searched was a checkbox ?
Don
I added it..if (this.id inputElement.attr('id',this.id);if(this.type=='checkbox')InputElement.attr('checked',this.attr('checked')); inputElement.attr('value',this.value); divContainer[0].appendChild(inputElement[0]); inputElement = $(document.createElement('input')); inputElement.attr('type','hidden'); }}and it errors out: this.attr is not a functioninputElement.attr('checked',this.attr('checked'));
Don
You can put your html. it might be something like this.parent.attr() or somewhat. This is the only way. You know your html I just put the way to do such things.
Muhit