Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Possible Autocomplete Implementations

Client-side

  1. FormBrowser-based autocomplete. This will work (if we’re okay with having suggestions based only on the user’s previous input field values in their browser rather than the searches being made by all users of that particular DDF instance), but browser autocompletion gives suggestions based on previous inputs from many input fields, not just a particular one. How can we avoid getting all the extra autocomplete suggestions from the browser? We can use the Web Storage API’s localStorage. When the user submits a query, add the query string to an array in the window.localStorage object (making sure there aren’t any duplicates). This data is stored in the browser and does not expire, so it could easily be used to power a <datalist> (an element that can be used to define the possible suggestions for an <input>) for the search input field. We could also use JQuery UI’s autocomplete or another JavaScript autocomplete widget if we wanted more configurability. This solution would allow input field value suggestions to persist between DDF restarts.

...