I am using Typeahead for my website and it is working for simple results but I want to map my autosuggest search to json objects and the search should return a text value to the search box and a ID to a hidden input field.
The json looks like:
"name": "STF Skeppsholmen Hostel, Flaggmansv\u00e4gen 8(Stockholm)",
"name": "Biz Apartment G\u00e4rdet, Sandhamnsgatan 67(Stockholm)",
but can be modified. When a user selects “STF Skeppsholmen Hostel, Flaggmansvägen 8(Stockholm)” I want the text input filed to be: “STF Skeppsholmen Hostel, Flaggmansvägen 8(Stockholm)” and the hidden input field to be 269315.
I guess bloodhound is needed to do this?
I also want the file to be preloaded if that is possible to speed up the search.
Current code is here: [url removed, login to view] this solution works but is based on the data source [url removed, login to view] which only includes one field, the name and not the ID.
Change this to [url removed, login to view] to get the json with ID and it wont work.
To avoid bot bids include the keyword “hotelStockholm” in your response. I will only consider offers if this keyword is included I your response.
20 freelancers are bidding on average €156 for this job
"hotelStockholm" , Hi, I can fix your script to insert id in hidden input "hId" , and I will preload data2.php. If you have question you can contact me. Regards