Forums

Use Autocomplete data to populate other fields on form

cyberspyder 13 Jul, 2019
Hello! I am working on an event submission form to use with JEvents . My goal is to pre-populate the location data if it exists in my table, to prevent errors with spelling, typos and people being lazy with the address, etc. I have built a table in the database that contains the local venues, with name, street, city, state, phone, website fields. I used the autocomplete function to populate the form with the name values. I would like then, to use the remaining data from that row in the table to populate the address, city, state, phone and website fields. I added a new location field in the event the location is not in the database. I intend to use PHP to determine which field to use when updating the events table.

However, I am having problems figuring out how to populate that data in the location fields. Attached is a backup of the form. [file=http://www.efortsmith.com.php72-2.phx1-2.websitetestlink.com/add-event]ADD EVENTS_13_Jul_2019_12_05_07.cf6bak[/file]
healyhatman 14 Jul, 2019
You'd need to do all that with javascript.

Can you instead use Google Address Autocomplete?
Max_admin 19 Jul, 2019
If you need to load multiple fields values based on one field then add your fields inside a "Container" area then set the field to "Reload" the container, and read the required data for the fields.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.