anderson_catchme Posted August 14, 2014 Share Posted August 14, 2014 Hello forum, So I've been developing an app mostly in PHP, but am rather afraid of JS. Hope to fix that. I have an AJAX dropdown using JQuery to search locations. It works great. However, I want to make it similar to what is seen on this site: http://placefinder.com/ As you can see, the dropdown, when clicked populates a box. Then the user submits the form and the data is used in the application. I have no clue how to make the form populate with data from the DB (I'm using mySQL) when clicked. So far, I've only been able to make it clickable as a URL (not what I want, obvioiusly!) Is there a way to do this on a really small, simple script for starters? I'm certain their is, but don't even know where to begin. Any help appreciated Link to comment https://forums.phpfreaks.com/topic/290445-ajax-dropdown-to-populate-html-form-for-get-request/ Share on other sites More sharing options...
CroNiX Posted August 14, 2014 Share Posted August 14, 2014 Do you mean the text box in the center that starts to populate some options as you type? If so, that's called an autocompleter. You can search for it or use something like from jQueryUI. http://jqueryui.com/autocomplete/ You'd just use "function" as the source and trigger an ajax call that hits a certain URL on your server. Then have your script query the db and return results back which then get populated in the "dropdown". Link to comment https://forums.phpfreaks.com/topic/290445-ajax-dropdown-to-populate-html-form-for-get-request/#findComment-1487806 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.