When a hint is shown using twitter typeahead I would like that to replace the query when a user clicks submit.
Example the user types in mo, the hint shows montana and the user can click submit and montana is submitted.
This is the same functionality if a use presses the right arrow key.
I stored the last results from the typeahead and set the first value when submit is clicked. Probably there's a better way to do this, but didn't find any resource about how to do it.
http://jsfiddle.net/wLak8L20/1/
Filter
Submit callback: