javascripttwitter-bootstrapbootstrap-typeaheadtypeahead

Bootstrap TypeAhead.js prevent invalid entry


I am using the bootstrap typeahead.js feature for autocomplete capability for 'state' lookup. How can I best prevent individuals from typing all (and not successfully picking Alaska) before submitting the form?


Solution

  • Typeahead.js does not currently support this behavior.
    You can use other libraries better suited for restricted options, for example Select2
    However I have working fork of Typeahead that supports this.
    See the JQuery example page here:
    https://github.com/Svakinn/typeahead.js/blob/typeaheadSimple/Examples.md