YUI Autocomplete: itemSelectEvent getting lost with IE6 and IE7?
Posted
by Parand
on Stack Overflow
See other posts from Stack Overflow
or by Parand
Published on 2010-05-14T18:50:51Z
Indexed on
2010/05/14
18:54 UTC
Read the original article
Hit count: 255
yui
|autocomplete
I'm using YUI Autocomplete (latest version loaded using loader as of today (May 14th, 2010), which looks to be 2.8.1, with the following options:
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]);
});
The itemSelectEvent catches selections in AutoComplete and fills in some data on the parent.
This works on FF, Chrome, Safari, and IE8. On IE6 and IE7, however, the event never seems to trigger. To replicate: In the autocomplete field, allow it to autofill for you, then hit enter. This should select the autofill and move on to the next field (that's what it does in other browsers). With IE6 and IE7 it seems to instead trigger the form submission - the itemSelectEvent never fires (or perhaps fires after the form submission?).
Has anyone seen this? Any work-arounds?
© Stack Overflow or respective owner