2 comments on “Twitter Typeahead.js v0.10

  1. Hi Eric,
    I have two questions about the second example (films).

    1) When I choose a film, how do I get the ‘year’ field into a javascript variable?
    2) How to get the films matching only the starting characters typed. Like substrRegex = new RegExp(“^”+q, ‘i’)?

    Thanks in advance.

    My wife doesn’t understand this things, and she don’t care. Its universal.

    • http://ericsaupe.com/using-twitter-typeahead-js-custom-event-triggers/ gives a bit of an idea of how to do custom event triggers which will let you access other fields in the datum.

      As far as the regular expressions I’ve looked around and can’t see anything obvious on how to limit it to just the first characters. You could increase the minLength to something a bit higher before it starts showing suggestions and that could limit the results to something that may be more accurate.

      Hope that helps.

Leave a Reply