Solved

Fast JavaScript Autocomplete

Posted on 2007-12-06
4
1,260 Views
Last Modified: 2013-11-19
I'm looking for an autocomplete script that I can use on my LAMP platform.

I have tried scriptaculous and it works fine but in IE it is VERY VERY VERY slow and unusable. The datasets being returned are quite large too.

The user is inputting country codes for phone numbers. So after they enter one digit, quite a few results come back, for instance, after you type the number '1', 1250 results are returned. Perhaps I could be smarter about the results, right now I am just querying  for 'textbox.value%' in the database.

Scriptaculous also seems to work kind of quirky in IE, but works great in FF and Safari.
0
Comment
Question by:dignified
4 Comments
 
LVL 11

Accepted Solution

by:
raj3060 earned 125 total points
Comment Utility
get the number of results first,  if you get too many results then don't apply autocomplete. This would reduce the execution time. Which would be the case when user is entering only one character, for two or more characters search would be more refined and you would get less results.
0
 

Author Comment

by:dignified
Comment Utility
It is tough though because I am going by dialing codes so if I enter "1", the most common one for the United States, if I query for '1%' I get about 1200 results. I can't really wait for more to be entered, because 1 is pretty common.

Are there any other scripts out there besides scriptaculous?
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now