this code is nice.but if this code can get data from database with xml it coluld be nicer.when i key pressed any key on textbox data must be updated.How can i do this.or is it imposssible ?
Can I include this in a project that is under the GNU General Public License (a.k.a. GPL)?
I read the "Creative Commons" and it is a little different (for example, it allows commercial use, but the GPL does not). However, it also says any rights can be waived or granted by the copyright holder.
Thanks so much for your friendly contributions. Indeed, we now use (and credit) this code in a non-GPL project we run, http://movielens.umn.edu (in the "Advanced Search" for other languages).
I read up on licensing, and here's what I found out. We cannot use it with a GPL project unless it is released under a GPL-compatible license. See http://www.gnu.org/philosophy/license-list.html#GPLCompatibleLicenses for more information on compatible software licenses.
Also, the creative commons discourages using their licenses for software, as they are designed for content, not software. See http://creativecommons.org/faq#faq_entry_3646
Sorry for all this licensing crap. I wish it weren't a problem, too.
I need this for email format. I tried to put
var customarray=new Array('Tom <tom@tom.com>', 'Tom <tom@tom.com>');
First one, it won't show the email address in drop menu but it will show in the text box.
2nd one, it shows in drop menu but < > is not showing properly in text box.
Also, i need to auto add the common , at the end when select.
[Edited] I got it working now for email.
line 58: var actb_delimiter = new Array(', ');
and
line 400: actb_curr.value = str.replace(/& lt;/gi, "<").replace(/& gt;/gi, ">") + ", ";
Wow.. this is a great tool. Thanks for the effort.
Now, the one issue that I currently have is with escaping of < and > characters. I can make them show up in the drop down list correctly, or be transfered back to the input field correctly, but not both.
Hmm... I personally don't use (and don't have) Opera so it wasn't tested on opera. I'll download opera and try to figure out whats wrong before the next release!
Hi and thank you for developing the Auto-complete Control
I have a couple of questions about the subject:
1- How can I move to the next control on the page when I press on the tab after I choose somthing from the list or even without choosing any thing?
Since when I text it, it just stay in the textbox !! Is it possbile also to go around this even if we have 2 or more autocomplete contorls
2- How can make the Auto-complete list appear when I put the Auto-complete Control inside a panel for example? When I test it now, the Auto-complete list appear behind the containing Panel... is there away around this?
I had this problem, too. The code in actb_checkkey treats enter and tab the same. However, I think the cases should be separated. A colleague had the bright idea of calling the "actb" function with another (optional) parameter that is the field to tab to, and using that in actb_checkkey. Clearly this would require some mods.
Cool stuff, for the most part. Saved me from having to write the guts of the function. Some other "polish" that would be nice, though:
1. The "tab" character should be treated the same as the "enter" character in auto-complete mode. The following case, if added onto the existing case statement, should do just that (in IE, anyway):
case 9:
evt.keyCode = 13;
actb_penter();
break;
2. When the string in the auto-complete textarea is evaluated, metacharacters are not escaped. This means that "." matches anything (except a newline, of course). That should be dealt with as the full-stop is a common character in email addresses and other strings that could utilise this sort of control.
3. Multiple "deliminators" (the word is actually "delimiter") should be supported. Many programs support a comma or semicolon as valid email address "deliminators". In my particular problem, I need to support metacharacters for "and" and "or", not just one global seperator.
That said, you've done much of the heavy lifting -- and made my current task that much easier. Thanks!
Thanks for your comments. i'll definitely try to include them in the next built. (although point 3 seems kind of tough but i'll try my best nonetheless!)
I'm trying to use this to emulate a combo box. With a popup you get a values. an ID, and Displaying Value.
For example
dropdown for User Names
34 => John Cusak
45 => Harison Ford
23 => Julia Moor
Wouldn't it be nice when user select from an existing option in the list, the associated ID will be set to a hidden id field. If the typed name is does not exist, then 0 or null will be set to the hidden ID field. I will be working on this for an application I'm currently writting, but if anyone has already made some progress, please let me. So I can avoide reinventing the wheel.
When you select the item with mouse. It puts undefine into the text box. I'll try to work on it, but if anyone has already had a solution then please let me know.
I've added multiple autocomplete to the widget, which works in IE5+ and Moz. Other browsers lack the support for DOM2 range traversal or any similar propietary methods.
However in non-supporting browsers it stills allows for multiple elements and the autocompletion of the last one
the code and demo is available at:
http://imaginocreativa.com/slump/autocomplete/index2.html
PS: check the TODO list in the source to see whats comming in the next days
Just integrated the menu and it works great and is very speedy compared to others I'd tried - great work!!
What I'm trying to work out is, is there anyway that when someone is typing in the input box, it doesn't automatically highlight the first word in the autocomplete menu ? Instead, a user has to press the down arrow key to select it.
This would be really helpful, as I would like users to be able to type in the input box and then, if they want to, hit down and use the menu only if they need to.