Important alert: (current site time 7/15/2013 10:01:35 AM EDT)
 

winzip icon

Ajax AutoSuggest (Contest Winner Script) Updated 9 June Excellent

Email
Submitted on: 2/14/2011 3:34:12 PM
By: www.amitpatil.me 
Level: Intermediate
User Rating: By 14 Users
Compatibility: PHP 3.0, PHP 4.0
Views: 30393
author picture
(About the author)
 
     For more codes and scripts visit "www.amitpatil.me" I m back again with this small code snippet PHP and AJAX Auto Suggets Script.Simple but nice, Ready to use script. Have A fun. Version 1.1 ---------------------- - Added jQuery Support - Changed Design Version 1.2 ---------------------- - Redesigned script - Added IE compatibility Version 1.3 ---------------------- - Added feature option selection with Keyboard Up Down arrow keys Version 1.4 ---------------------- - On clicking outside the list, list gets closed (That feature should be there in first version but i forgot that condition ) - "No matches found" message

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 8 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

6/13/2008 4:27:13 AMnoName

hey buddy ur code is great thanx for it
(If this comment was disrespectful, please report it.)

 
3/27/2009 6:20:05 PMClaude

Code works great, I just made a small modification to it, when an item in the list has an apostrophie you will not be able to select it so I added a addslashes in your code

onClick=\"display('".addslashes($row['name'])."');\"

of course you need to know that I used your code for another db than country.
(If this comment was disrespectful, please report it.)

 
4/11/2009 5:53:08 AMDuong nam phong

I think it's nice, I'm learning about php and I learned a lot from you and from this website, thank
http://thuquangcao.com
(If this comment was disrespectful, please report it.)

 
4/11/2009 5:54:24 AMDuong nam phong

I think it's nice, I'm learning about php and I learned a lot from you and from this website, thanks
http://thuquangcao.com
(If this comment was disrespectful, please report it.)

 
4/17/2009 2:12:57 AMidwan

thanks this's great
(If this comment was disrespectful, please report it.)

 
5/27/2009 8:07:51 AMVaibhavSam

Hi,

How can I select options in dropdown via keyboard up/down arrow key ?
Currently, I need to use the mouse.

Thx
Vai
(If this comment was disrespectful, please report it.)

 
9/21/2009 2:20:06 AMJon

Beautiful gui, beautiful coding
(If this comment was disrespectful, please report it.)

 
1/8/2010 8:20:05 PMHEK

Hello,

great work and a really big java, but not perfect. I played with your demo but with own datatable, but its not possible to use the keydown at the beginning of selection, just from down to above or just above than down, so its not possible to select the second entry by pressing 2 times the down Key.

I used your work in a form tag and post the page, so when I select an entry from the suggestion by pressing enter, the field was updated but it was'nt send to the next page (post) just with the typed letters, not the selected entry.

Looks like that Enter triggers first the Formpost and than the update of the field.

But keep up the great work you've done here.

BR
HEK
(If this comment was disrespectful, please report it.)

 
1/9/2010 9:44:31 AMHEK

Hi again, I played around to find a solution for posting the selected value from the ajax field. so i used a hidden field in a form and fill this field by adding it in the jquery.js in the section of Click by mouse or select entry by enter that works fine, but the next problem is, it works just when i select an entry from the list, if i just type something in, the hidden field is empty.... So I really play and try it out, so it would be very great if you can give a tip what do to, to implement the field inside a form. (problem with enter > submits first the page and do no update :(( Also I want to use in the select a like %variable% , this doesnt work correctly because the query shows strange things ... :( also i've got a lot of entry's saying "tom / grennweak (possible a problem with special chars?? like ' or an e with an appostroph... Thanks in advance HEK
(If this comment was disrespectful, please report it.)

 
3/8/2010 11:11:25 AMjim

Would appreciate a hint on how and where in which script to add submit button to send the "id" of a selected country to another php page for further processing. I think HEK was on to this but did not give enough detail for me. Thanks
(If this comment was disrespectful, please report it.)

 
3/8/2010 4:14:27 PMjim

OK, ignore earlier question. Got a submit button to work by adding a form tag and button on Index page. If it will help anyone I will be glad to post snippet.
(If this comment was disrespectful, please report it.)

 
4/16/2010 6:11:12 PMHEK

Test
(If this comment was disrespectful, please report it.)

 
11/13/2010 12:56:24 AMMoch. Zawaruddin A

wow,.,. it's cool,.,. thanks,., ^_^
(If this comment was disrespectful, please report it.)

 
2/11/2011 3:59:51 PMLiDoNg Ghon

the code was great..i like it coz its very beautiful..but i thing that makes it ugly, the keydown event. when you try to press the keydown, it jump up to another list..not to the result list of suggestions..
(If this comment was disrespectful, please report it.)

 
2/15/2011 1:46:20 AMAmit S. Patil

@LiDoNg Ghon : Please go to www.amitpatil.me and download the updated plugin.
(If this comment was disrespectful, please report it.)

 
2/24/2011 7:08:21 AMLiDoNg Ghon

the updates seems very good. Very nice code men. Tnx for sharing. It was a geat contribution.
(If this comment was disrespectful, please report it.)

 
2/25/2011 8:17:54 PMLiDoNg Ghon

i have a problem in this. when i try to plug this to my page, it wont run. i found out that it doesn't run when you have a query string.
example: http://www.amitpatil.me/php-ajax-autosuggest-jquery-plugin/index.php?id=1 ...
did i miss something?
(If this comment was disrespectful, please report it.)

 
2/25/2011 8:20:26 PMLiDoNg Ghon

i have a problem in this. when i try to plug this to my page, it wont run. i found out that it doesn't run when you have a query string. .
example: http://www.amitpatil.me/php-ajax-autosuggest-jquery-plugin/index.php?id=1 ...
did i miss something?
(If this comment was disrespectful, please report it.)

 
2/27/2011 5:29:09 AMLiDoNg Ghon

i have a problem. when i try to plug this in my page, it doesnt run at all. when i remove the query string in the address bar, it run.. does the query string affect the plug in?? did i miss something here? example of my query string: index.php?item=form
(If this comment was disrespectful, please report it.)

 
3/11/2011 12:51:48 PMnnamdi osu

Most times i wonder why you are not called the king of php/applications. I have been following your submissions and even gone to your site. You are the best. Thank you for making it easy for novice programmers like us. Thank you
(If this comment was disrespectful, please report it.)

 
7/22/2012 12:44:02 PMmafuclero

Una mano soy nuevo y quisiera saber si quiero usar dos autoggest y con los caracteres especiales que debo de hacer para que me muestre resultados cuando escriba la letra ñ o usar dos autogest .
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.