I am using Bootstrap Typeahead which I got it from GitHub 1891669. It brings up the suggested words but would like to fix two issues:
- When I click on the item it just prints 0 in text field. What do I do so it prints the full word?
- How can I make each suggest clickable with the suggest word?
I looked at the code. The Typeahead javascript has the following:
$.fn.typeahead.defaults = {
source: []
, items: 8
, menu: '<ul class="typeahead dropdown-menu"></ul>'
, item: '<li><a href="#"></a></li>'
, onselect: null
, property: 'value'
}
so I would like to make href="mylink.php?term=**theword**"
so how can I insert suggested word in place of theword in href above so when user clicks on the link it just doesn't fill the text field but rather goes to mylink.php
with the parameter.
In that example I have inserted the Typeahead javascript with bootstrap.js. To make it simple for you to view the Typeahead java script here.
thanks