1

I'm using the standard JQuery Autocomplete with jquery-1.7.2.js in a .net site When on IE 6.0 the known bug 'Could not set the selected property. Unspecified error.' is hit.

One of the many workarounds is in place for this i.e. on select :

select: function (event, ui) {

//-------------- [ IE 6 Fixes ] ------------------
if ($.browser.msie && (jQuery.browser.version == '6.0')) {
   var id = $(select).attr('id');
   $.each(select.children(), function (index, val) {
   if ($(val).attr('value') == ui.item.option.value) {
 document.getElementById(id).selectedIndex = index;
                                }
                            });
                        }
                        try { ui.item.option.selected = true; } catch (e) { }
                        try { self._trigger("selected", event, { item: ui.item.option }); } catch (e) { }
                        //---------------------------------------------------

However when the error is hit in an IE 6.0 browser I'm losing the top item in my drop down list (364 items becomes 363 and the 1st item is notthere). It seems to be related to hitting this bug although nothing I've read has mentioned this kind of side effect.

Anyone know about this?

$('select#Tests').children().length gives me my list 364 long. After I hit the error (code above catches and ignores it) it returns 363 and the first item is missing.

4

0 回答 0