Okay, I have been messing with this autocomplete stuff for 2 weeks now, and it's starting to give me a headache! I've gotten it to do almost everything I need, but I'm hung up on one issue. I have two autocomplete text inputs that are tied together. The first input allows the user to select a person from a MySQL database table. Then, based on that selection, the second input allows the user to select one of the person's addresses from an addresses database table. This part all works fine.
The problematic autocomplete field queries an addresses table and stores each result in an array slot as follows:
title|street_address|city|state|zip
The trouble comes when simply trying to output the selected item's data to the innerHTML of a SPAN tag.
I've used the formatItem option to only display the title in the autocomplete list. Upon selecting the item I want it to then show the street_address, city, state and zip in a SPAN tag below the input box. It's getting the information, but since the formatItem function automatically reads through every row, it is displaying the street_address, city, state and zip of the last item in the list instead of the one that is selected. However, what is returned to the text input is the title of the selected item. It's very frustrating!
Does anyone know how I can get this issue sorted out???
Thanks in advance for any help!