[jQuery] Re: select value lost after clone in IE

2007-06-04 Thread Brandon Aaron

Ooops ... forgot the URL ... http://dev.jquery.com/newticket

On 6/4/07, Brandon Aaron <[EMAIL PROTECTED]> wrote:


Could you please create a new ticket for this? Thanks.

--
Brandon Aaron

On 6/4/07, Jesse Skinner < [EMAIL PROTECTED]> wrote:
>
>
> It seems that after a jQuery clone(), the value of select boxes are lost
>
> in IE (but not Firefox). Try this out:
>
> 
> 
> one
> two
> 
> 
>
> $(function(){
>  $('div').clone(true).appendTo('body');
> });
>
> The first option will be selected in the cloned select.
>
> Doing something like this fixes the problem (as long as there is only
> one select box), though I suspect there needs to be a better fix in
> jQuery explicitly:
>
> $(function(){
>  var old = $('div');
>  var clone = old.clone(true);
>  var select_val = $('select', old).val();
>  $('select', clone).val(select_val);
>  clone.appendTo('body');
> });
>
> Cheers,
>
> Jesse
> www.thefutureoftheweb.com
>




[jQuery] Re: select value lost after clone in IE

2007-06-04 Thread Brandon Aaron

Could you please create a new ticket for this? Thanks.

--
Brandon Aaron

On 6/4/07, Jesse Skinner <[EMAIL PROTECTED]> wrote:



It seems that after a jQuery clone(), the value of select boxes are lost
in IE (but not Firefox). Try this out:



one
two



$(function(){
 $('div').clone(true).appendTo('body');
});

The first option will be selected in the cloned select.

Doing something like this fixes the problem (as long as there is only
one select box), though I suspect there needs to be a better fix in
jQuery explicitly:

$(function(){
 var old = $('div');
 var clone = old.clone(true);
 var select_val = $('select', old).val();
 $('select', clone).val(select_val);
 clone.appendTo('body');
});

Cheers,

Jesse
www.thefutureoftheweb.com