title: Twitter Bootstrap Typeahead force selection
body: <p>I'm using the Bootstrap Typeahead plugin in my app, and here is my code (it's an example).
  I'm looking for a way to validate the selection of the user (basically if the input did not match any results -&gt; empty the box on blur). The result must match. I searched everywhere and couldn't find a thing. Your help would be highly appreciated.</p>
  <pre><code>$('#search').typeahead({
      source: function (query, process) {
          var states = [];
          var map = {};
  
          var data = [
              { &quot;stateCode&quot;: &quot;CA&quot;, &quot;stateName&quot;: &quot;California&quot; },
              { &quot;stateCode&quot;: &quot;AZ&quot;, &quot;stateName&quot;: &quot;Arizona&quot; },
              { &quot;stateCode&quot;: &quot;NY&quot;, &quot;stateName&quot;: &quot;New York&quot; },
              { &quot;stateCode&quot;: &quot;NV&quot;, &quot;stateName&quot;: &quot;Nevada&quot; },
              { &quot;stateCode&quot;: &quot;OH&quot;, &quot;stateName&quot;: &quot;Ohio&quot; }
          ];
  
          $.each(data, function (i, state) {
              map[state.stateName] = state;
              states.push(state.stateName);
          });
  
          process(states);
      }
  });
  </code></pre>