Creating an auto-suggest field with jQuery |
[eluser]Mike DeFelice[/eluser]
Missing on small step! When you click on your drop down you need to let it know to fill your form with that value, there is probably a nicer way then what it down below, but it does the job. I tried to attach a file because the forum is cleaning out the javascript of the code but I keep getting invalid MIME type. Where you have Code: echo '<li>'.$row[english].'</li>'; you need to add inside your <li> Code: onClick="fill(\''.$row[english].\'')"
[eluser]hi8is[/eluser]
First off - thanks for helping out. =) I'm pretty new to php and mysql but am doing my best. Here is the line I added: echo '<li>'.$row[english].'</li>'; No luck thou =( When I use firebug to investigate the action when clicking on a line item - it gives me the following(see screenshot at this url): https://skitch.com/trevorcaesar/rpd58/car-parts-now Again - the page in question is: http://www.car-parts-now.info/aman/index2.php Thanks again for the help everyone and anyone - this is important to me and i appreciate it greatly.
[eluser]Mike DeFelice[/eluser]
I checked out the site and the following worked. You need a single quote around the list item you want fill('Car Item') and it fixed it when I tried your site.
[eluser]hi8is[/eluser]
Thanks a ton Mike - maybe that will give the original poster some insight too. =) You the man - man!
[eluser]defectivereject[/eluser]
Not sure if you fixed it, but this works a treat for me, courtesy of IBM CI tutorials Controller Code: public function skillsuggest() { Model Code: function find_qualheld($str) { View Code: <?php jQuery function Code: $(document).ready(function() { I'm not saying its the most efficient of code, but it works. i have 8 different versions of this working across an intranet i developed. If you use it more than once for different searches, just change all function names, and field id's e.t.c. Hope it helps :/ |
Welcome Guest, Not a member yet? Register Sign In |