I'm doing research using JQuery's Autocomplete plugin and Google Maps' API. What I have so far is located here. I'm using Asp.net MVC to generate the list of potential address matches (limited to US addresses only) and presenting them as a pipe-delimeted list to Autocomplete, which is supposed to be .split
ing them up and suggesting them to the user.
Here's the javascript:
$(document).ready(function() {
$("#address").autocomplete("/Address/Address/").split('|');
});
Here's what Address/Address?q=3118
is returning:
Galax Dr, Statesville, NC 28677, US|State Highway S-46-148, Gastonia, NC 28052, US|
The problem I'm having (besides a stubborn IE-only javascript error, which I'll break into another question), is that only the first result is suggested.
This page clearly shows two results, yet typing "3118" into the textbox produces only the Galax Dr
result. How can I get Automplete to produce both results?
EDIT: cleaned up the code to get rid of that "test code" vibe
EDIT: fixed myself by replacing pipes with CRLF and removing split()
. New javascript:
$(document).ready(function() {
$("#address").autocomplete("/Address/Address/");
});
Autocomplete is my new best friend :)