Topic: Update <options> in IE

I have following code working correctly in firefox

#in RJS file
page["myid_#{@my_var_id}_price"].down(0).replace "<option value='#{@my_var_value}'>#{format_number(@my_var_value)}<option>"

But this does not work in IE, there is an empty list when clicking on the select element.

Does anyone know why ?

...Or is there a easier way to replace the options for a select element with RJS ?

Thanks for any hints.

Re: Update <options> in IE

boemitsu wrote:

...Or is there a easier way to replace the options for a select element with RJS ?

Thanks for any hints.

Re: Update <options> in IE

This seems to be a bug in IE, see

http://support.microsoft.com/kb/276228

even MS classifies it as a bug...although they do not mention IE 6, it also applies to that version

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

....good to know that they know that its a bug...


Anyway I solved it with the following direct JS (I only need a single option so this helps me out)

page << "$('myid_#{@my_var_id}_price').options[0] = new Option('#{format_number(@my_var_value)}','#{@my_var_value}',true,true)"