Open sugaroverflow opened 9 years ago
The reason I developed it in this manner is to give the user an option. For instance, maybe the user decides to type in "New York University" as opposed to "NYU." The user should be able to see this as a suggestion to validate his/her input. Both options will bring up the same node anyways.
I had to do a similar autocomplete for OpenData500. I used a jquery autocomplete library. For this issue I have a look up json file where I keep name and a label. The label includes all the searchable items, so:
{
"name":"New York University",
"label": "New York University NYU"
}
jquery autocompletes looks through "label"
's but displays only "name"
. so if a user types "NYU", they'll see and select "New York University".
Interesting, I didn't realize jQuery had an autocomplete library. I could generate another .json file rather than having to create an associative array inside the codebase. Awesome suggestion!
John put my name in (as Fatima Sarah Khalid) during CodeAcross and added a nickname/abbreviation field (as Fatima Khalid) but I'm coming up twice in the autocomplete.
I tried this with other entities that have abbreviations/nicknames and the same thing happens.
I'm not sure if this is something that we want to have.