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 (me.highlighted.id != undefined){ me.acChoose(me.highlighted.id); }

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){ alert(id+'-'+label); }

var AC2 = new dmsAutoComplete('string2','acDiv2'); AC2.chooseFunc = function(id,label){ alert(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.

comments powered by Disqus

Related Posts

Changes on their way

Changes on their way

  • November 22, 2010

So over the next few weeks this space right here is going to be seeing lots of changes.

Read More
Screencast: Utilizando o dmsAutocomplete com banco de dados

Screencast: Utilizando o dmsAutocomplete com banco de dados

  • January 10, 2008

Uma das perguntas que mais respondo pelo blog é “Como faço para utilizar o dmsAutocomplete com registros da base de dados?”. Além disso, a muito tempo procuro uma “desculpa” para fazer um screencast. Decidi então juntar estas duas situações e fazer o primeiro screencast da DMS Systems.

No video apresentado neste post vou demonstrar como fazer uma simples adaptação ao script PHP que vem incluído no dmsAutocomplete para que o mesmo busque dentro de uma base de dados e não mais dentro do texto como o exemplo demonstra. Usarei uma base de dados mysql simples e farei as conexões e busca de resultados utilizando as funções básicas do PDO, portanto se não conhecem esta nova camada OO de abstração de conexão com a base de dados, sugiro que procurem sobre, pois ela facilita e organiza bastante o trabalho com base de dados no PHP.

UPDATE: No momento o serviço que hospeda o screencast esta offline, o screencast deve voltar na quinta ou sexta

UPDATE: Screencast no ar novamente

Read More
Seven Things you might not know about me

Seven Things you might not know about me

  • January 4, 2009

Cool, I think this is my first English meme/tag, so let’s go.

Read More