I am using twitter bootstrap typehead.
$(document).ready(function() {
$("#searchfield").typeahead({
minLength: 3,
source: ["type1", "type2", "dtype3", "dtype4"]
});
});
I want to display all the soucre in the drop down(suggestion drop down), when I focused on input tag (“#searchfield”) even it is empty. That means I want all source to display when I didn’t enter any letter. If I entered any letter it needs to show the relevent data (normal functionality of typehead.)
OR
On clicking on some link. dropdown need to provide all given source.
Example:
<a href="#someId">Click here to populate typehead in #searchfield input tag </a>
<input type="text" id="searchfield">
On cliking the link, the input field needs to populate the dropdown with all given sources(type1, type2, dtype3,dtype4)
I changed the following method in the plugin like this
And binded the click event to anchor tag(
<a id="someID" ......)Hope this may help to others..