Autocomplete YUI自动完成:itemSelectEvent与IE6和IE7一起丢失?

Autocomplete YUI自动完成:itemSelectEvent与IE6和IE7一起丢失?,autocomplete,yui,Autocomplete,Yui,我正在使用YUI Autocomplete(从今天(2010年5月14日)起使用loader加载的最新版本),它看起来是2.8.1,具有以下选项: ac = new YAHOO.widget.AutoComplete("mynode", "autocomp_node", ac_ds, {typeAhead: true, forceSelection: true}); ac.itemSelectEvent.subscribe( function(type, args

我正在使用YUI Autocomplete(从今天(2010年5月14日)起使用loader加载的最新版本),它看起来是2.8.1,具有以下选项:

ac = new YAHOO.widget.AutoComplete("mynode", "autocomp_node", 
              ac_ds, {typeAhead: true, forceSelection: true});

ac.itemSelectEvent.subscribe( function(type, args) { 
              alert("hey:" + args[2][1]); 
              $('#parent_id').val(args[2][1]);
});
itemSelectEvent在AutoComplete中捕获选择并填充父项上的一些数据

这适用于FF、Chrome、Safari和IE8。但是,在IE6和IE7上,事件似乎从未触发。要复制:在“自动完成”字段中,允许它为您自动填充,然后按enter键。这应该选择“自动填充”并移到下一个字段(在其他浏览器中就是这样做的)。使用IE6和IE7时,它似乎会触发表单提交-itemSelectEvent不会触发(或者可能在表单提交后触发?)


有人看到了吗?有什么解决办法吗?

下面是YUI示例的摘录。实际上,这是示例中适用的“preventDefault”方面。也许您可以使用类似的方法阻止表单提交。但是,我不确定这是否会阻止触发其他事件(即itemSelectEvent)


你想出来了吗?带着类似的头痛坐着。没有。如果我没记错的话,我不得不修改一大堆东西来解决它。
// Rather than submit the form, 
// alert the stored ID instead 
var onFormSubmit = function(e, myForm) { 
   YAHOO.util.Event.preventDefault(e); 
   alert("Company ID: " + myHiddenField.value); 
}; 
YAHOO.util.Event.addListener(YAHOO.util.Dom.get("myForm"), "submit", onFormSubmit);