dmsAutoComplete v1.1 – ChangeLog

Recently I published an updated version of my auto-complete (Google suggest) script compatible with IE and FireFox and based on PHP/AJAX.

After publishing version 1.0, I had some feedback from people who downloaded an tested it, so now I decided to correct some of the bugs that were found, and make a few improvements also. So now I’m going to publish version 1.1, check out some of the changes I made.

FIX: Pressing TAB/ENTER with nothing selected returned an error message
Always when TAB/ENTER was pressed without any list item selected an error message was returned because the script couldn’t find the value it expected to find, this issue was resolved by adding a flag that made the script ignore this command in this case, causing it to just hide the div.

if ( != undefined){

CSS: FireFox showed no linebreaks
Who tried out my script in FireFox noticed that sometimes the list appeared on a single line, with no line breaks between the items, a simple change in the CSS style of the LI element resolved the problem

#acDiv UL LI{ display:block;}

FEATURE: Adding multiple auto-completes in a single page
Due to the way I was referencing the AC object in the script it was impossible to change the name of the variable that received the object. So adding more than one was an impossible mission. Adapting the reference I made it possible to add multiple scripts, as in the example:

var AC = new dmsAutoComplete('string','acDiv');
AC.chooseFunc = function(id,label){

var AC2 = new dmsAutoComplete('string2','acDiv2');
AC2.chooseFunc = function(id,label){

Version 1.1 of the script is available in the same link as before:

If you would like to know more about the scripts history look here

If you happen to find the script useful and decide to use it in your solution please let me know, give me some feedback on the bugs, and let me know how it worked for you.

This post is also available in: Portuguese (Brazil)

6 thoughts on “dmsAutoComplete v1.1 – ChangeLog

  1. Ao pressionar as teclas UP/DOWN sem ter iniciado a busca, ocorrem vários erros no javascript.

  2. I love your script, but I cannot get it to work on my site. I don’t get any error messages, but the drop-down box never gets populated with any items. The example on your site works fine for me. I am using PHP 5, and I’ve set permissions for your files to 755. Any thoughts on what I might try? My example page is here:


  3. OK, I was able to get your script to work on a different server, but I really need to get it to work on my own. My server is running PHP Version 5.1.6, while the server on which I got it to work is running Version 5.2.1-0.dotdeb.2. Should this make a difference as to whether your script will work? Are there any other environmental variables I should be checking?

  4. The Script is working fine.I am getting small problem when ever i type drop down is coming but All the select boxes in that page disappearing after selecting one option again select box are visible again. Please let me know how to avoid this


  5. Sobha,

    That’s right, this happens because in some browsers the auto-complete div cannot stay on top of the slect boxes, so i hide them all and return them afterwards.
    There is a true/false flag to disable this behaviour, just add this line to the script invocation:

    AC.hideSelects = false;

    That should stop that behaviour, but beware if you have any select below the auto-complete div, for thei will stay over the div in som browsers.


Comments are closed.