How to set value to an input field (programmatically) bound by typeahead
In my app, I bound an input field to the typeahead. After ths I am unable to set value to the input field using the .val() method. It doesn't seem to work.
Even when I set the value to the hidden input.tt-hint and span classes, still it doesn't work.
It works only when I manually type something into the input.
Can someone help me on this...
You should use the setQuery method of typeahead for this. In case you are using the prefetched option, you should do this on the typeahead:initialized event. For example $('#yourBoxId').typeahead('setQuery','yourValue')
Thax Svakinn. It works perfect!
Not in this version but in this case the JQuery val() functon works perfectly. var currentValue = $('#yourBoxId').val();