I’m creating a web application for work where the user has to enter the name of the person that requested the job. I’d like to create a simple AJAX auto-suggest dropdown so they don’t need to type the entire name. On the backend, the database will provide suggestions based on previous entries. The website is built using CakePHP 1.1.
I know there are a lot of libraries out there, some better than others. Which do you think is the fastest and easiest to implement?
Since you are using CakePHP 1.1 I suggest you check out the Manual portion that deals with Helpers
If you go down to ‘AJAX’, you can see you can do something like this in your controller:
And in your
autocomplete.thtmlview, you would have:And to create the autocomplete field in another view, you would do:
In order for this to work you need to have ‘Ajax’ in your
helpersarray, and have the Prototype/script.aculo.us libraries included.Good luck.