views:

53

answers:

1

Hi, Two questions regarding yui autocomplete:

  • Is there a way to make yui autocomplete mouse selection and keyboard up/down selection create only one selection at any time ?

  • Also is there any way to update the text in the autocomplete textbox with the selection done with keyboard up/down arrow only ie force the selection to appear in the textbox above if user selects in with up/down arrow keys ?

Note that in the following link I see deep blue for keyboard up/down arrow and light blue for mouse selection. (Remove the underscore before http in your browser url)

Case #1: _http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_array.html

However in the following link(case #2) this is not the case. I see only one selection (dark blue) at one point of time.

Case #2: http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_xhr.html

If I use the mouse and/or key up/down, there is still only one selection dark blue always.

My application is behaving as in case #1 but I would like it to behave as in case 2 above, with only one selection at any time and in addition update the text when user moves with the keyboard up/down arrow keys.

How can I make this happen? Both the above examples are using YUI autocomplete, but I can't see the difference between the two to make my app follow example 2.

In summary I want this to behave as google suggest does in www.google.com

Thanks,

Viji

A: 
var myConfigs = {typeAhead:true, autoHighlight:false, prehighlightClassName:""},
    myAutoComp = new YAHOO.widget.AutoComplete("myInput","myContainer", myDataSource, myConfigs);

By the way, prehighlightClassName is disabled by default so you really shouldn't need to specify it in the configs.

Jenny Donnelly