Love this control! It was exactly what I was looking for.
I've got a form where depending on the search type I need to enable and disable auto-complete for a field. Anyone know a clean way to disable the auto-complete? I've tried obj.actb_clear(), and about ten other things, but I can't get it to disable properly without errors. I've resorted to re-loading it with an empty array (which is an ugly way to do this):
obj = actb(document.getElementById('keywords'),[]);
I'm SURE there's a simple way to do this. Thanks to anyone who figures it out....
This maybe obvious to some but I thought I would contribute since I have been playing with this code.
One of the problems I was having was that after you used the text box a couple of times, the IE autocomplete dropdown box was confusing matters with previously entered items. I decided to come up with some code to remedy that.
You only need to add a couple of things into the .js file. The first line allows you to turn the functionality on or off for the field, from where you declare the actb object
Firstly in the Function actb where the Public Variables are declared add this:
/* ---- Public Variables ---- */
this.actb_ieautocomplete = 'off'; //Turn off the IE autocomplete feature for the selected field
Then in the Private Variables section after this part:
/* ---- Private Variables---- */
this.actb_keywords = ca;
var actb_self = this;
actb_curr = obj;
ADD THIS:
// Turn off the IE autocomplete for the variable
if (actb_self.actb_ieautocomplete == 'off'){
actb_curr.setAttribute('autocomplete','off')
}
Then when you declare a new ACTB obj you can turn the IE autocomplete on or off
obj = new actb(document.getElementById('textbox_id'),customarray);
obj.actb_ieautocomplete = 'on'; // Turn Internet Explorer autocomplete on
obj.actb_ieautocomplete = 'off'; //(Default Option) Turn Internet Explorer autocomplete off
i have two textbox on my page and im using your control.. when i run the page, only one of the textbox works.. its either the first one or the second one, is it because im using the same method on both of my two controls? if so, can someone shed me some light.. id really appreciate it. thanks. email me @ djbuan@yahoo.com!
It's an excellent autocomplete version but I have on question.
I use this script in an IFrame for searching. But the IFrame is rather small and the suggested list ist bigger than the frame. So the suggestions where not completely displayed.
Is there a possibility to show the suggestions over the border of the iframe.
When we get search result under textbox first element is by default selected .... I want it to be selected after down key press ....
how it can be done???
When we get search result under textbox first element is by default selected .... I want it to be selected after down key press ....
how it can be done???
Hi, I am using Visual Syudio 2.0. I am using AutoComplete property of DataGridView cell. I have chnaged the font style of cell. I want to change the font of the autocomplete list. How can I do it? Do you have any idea?
I wrote this into a .NET control and have written an article about it, http://www.codeproject.com/useritems/AutocompleteTextbox.asp, incase anybody is interested.
This is a really nice little textbox; it's very well written and looks good. Thanks, great work!
I have spent a few hours this afternoon converting this into a .NET user control (which I did in .net 2.0) which can be dropped into a page file like this:
3. To set the items, just do something like this in your code-behind file at any time (the string array could easily come from a database, XML source, or anywhere):
I find this implementation to be quite excellent! Does anyone know of any custom controls that would provide this same functionality, but in Windows Forms instead? Particularly, I am interested in the ability to type the delimiter (, or ; ).