0

I'm using a Typeahead and Bloodhound feature that provides some suggestions. When a user selects a suggestion I want to assign the input with that value.

However, this doesn't seem to work in its current iteration.

<input id="fruit" name="fruit" value=""/>

$('#fruit').bind('typeahead:select', function(ev, suggestion){
    var name = suggestion.label;
    $("#fruit").typeahead('val', name);
    return false;
});
WebDevDanno
  • 1,122
  • 2
  • 22
  • 50
  • create jsfiddle if possible, by adding all files + code into it – Dhara Parmar May 27 '16 at 13:53
  • What value do you want to assign to which input? What does your typeahead declaration look like? Have you checked out [the docs](https://github.com/twitter/typeahead.js/)? – trenthaynes May 28 '16 at 21:25

0 Answers0