AutoComplete.js update 1.2
I’ve completed an update/rewrite of my AutoComplete (Google suggest) widget. It now also includes a complete API document similar to the HelpBallons API.
Examples: http://www.beauscott.com/examples/autocomplete
Download: http://www.beauscott.com/examples/autocomplete/autocomplete.zip
SVN: svn://beauscott.com/widgets/AutoComplete
As always, please let me know if you have any issues or suggestions.
Beau
It would be nice if the list scrolled continuously when the down arrow is pressed down. Right now, we have to keep pressing it over and over to scroll down the list. It helps a lot on long lists.
Thanks for the feed back venkat!
I’ve added that feature!
Am I able to store an id with each option so when the user selects an option i can somehow get the id of the oprion and use that in my form submit.
Seems to have a issue if you stay type car and it will return a lot of cars then the results? Can this be changed?
I am having a difficult time adding any style to this select box. Do you have any suggestions for me.
Thanks
When I type a beginning of a word, the script gives me suggestions. But when I change my mind about last letter I typed and delete it (still leaving more than 3 characters in the box) there are no suggestions shown. I have to delete one more letter and enter it again to see suggestions list.
This in not very convenient, would you mind changing this behaviour?
Thanks.
Hey man your script is great, I test it in diverses browser and in ff3 on linux the it’s load but the css not render so good, some idea how can i fix it?
There appears to be a bug using this script with Firefox 3. On my sites, the results are shown but clicking on one only makes the suggestions disappear, it does not update the text field. Everything works fine in Firefox 2.
Thanks for this great library! I’ve been looking for one like this for a while now. It’s very flexible, very easy to implement, very lightweight.
I know you’ve been getting a lot of suggestions already, and i know that could get annoying. But here is another one :-p
to be like the real google suggest, whenever a suggestion is selected the value in the input field should mirror the value of the selection, and when “TABS” out, the value should remain. and when hit “ESC” the value returns to what was typed, not the suggestions.
I modified your code to do this by a bit of touch up in the _suggest method. i have a value storing the current input, whenever a suggestino is selected, the input field changes, when tabs out, the new value stays, when escape, the value returns to what i stored.
Even without this functionality, i still think this is a great library. Thanks a bunch!
I just started using it and really like it so far. A couple suggestions:
1) I’d like more events to hook into. In particular I’d like to know when an ajax request starts and completes.
2) I’d like an option to add an ajax spinner (working) graphic to the text input box while an ajax request is happening. This could be accomplished manually if there were options like in my first request.
Another suggestion: When highlighting an option in the select via the keyboard and pressing TAB, a selection of that option should be made. What happens now is that it just hides the select.
BTW - I have modified the source to include all of these suggestions. If you (or anyone else) is interested, you can contact me at bartlewis[at]gmail[dot]com
I downloaded it yestoday,and I found an error on it.
When you type some character,and do not move up/down key,then there is no options selected,then if you push “Enter” key,you get an error.So I modified the function like below:
select: function()
{
if(this.selector.options.length){
var index = 0;
if (this.selector.selectedIndex != -1)
{
index = this.selector.selectedIndex;
}
this.input.value = this.selector.options[index].value;
}
this.cancel();
if(typeof this.options.onSelect == ‘function’)
{
this.options['onSelect'](this.input);
}
}
Then it works fine.
Maybe it’s not right,because I havn’t read the all of the code right now.
Hy,
I like this script, is simple!!!
Is possible can call the suggestions (autocomplete combo) of a button? I like add an button “Suggestions” to make easy to peoples.
Thanks, sorry for my bad english.
Oops, typed some xml, which has been stripped away for about 50%!
Hi Beau,
the Autocomplete works fine, except that I can not work with special characters like german umlaute (ü,ö,ä,ß). Tried to encode the results if umlaute are in but this shows e.g. ü in the selection.
I would appreciate any suggestion.
Regards Georg
is it possible for to make the autocomplete automatically requery for new results when you select a suggested item? I’m using it to autocomplete path names, so it would be nice if selecting a directory automatically showed all the subdirectories…
Hi,
The value of the initial position is incorrect when using iframes
you can see this screenshot here:
http://pressenter.com.ar/~ftoledo/tmp/Screenshot.png
any workaround for that issue?
Sorry, my mistake in last post,
im not using iframe , but is a div with overflow: scroll
This is great! I like this much more than the ASP.NET AutoCompleteExtender which I was using previously. One addition I would like to see is support for more events - OnSending and OnRecieved in particular. I’d love to have an indicator message/image to let the user know that something is happening and these events would be key in updating the UI.
Also, the input element gets passed into the OnSelect event, but the item that was selected does not. This means that you can’t customize processing based upon what was clicked - which is something else I was trying to do. For example, if item A was clicked navigate to page-A.html, if item B was clicked, hide a div, etc….
I managed to modify your code to accomplish both of these remarkably easily (thanks for writing good code!) but I figured the feedback would be nice.
it’s very nice!
Can i use it in ASP and how?
Thanks.