I am using typeahead js extension from twitter bootstrap for autocomplete field. I have a subtle problem with this. I have a text box like:
<%= text_field_tag :search, params[:search], :data => { :provide => 'typeahead', :source => ...} %>
The problem is that I have to specify name = 'search' (with: search) in order to be able to capture the value of the text input search. However, if I do this, the browser will automatically create an autocomplete history for entries that I have already tried in my text box.
If I delete: search and replace with '', the browser will not be able to save the history, because there is no name attribute in the text box. However, in this way, I cannot get the entered value myself.
How can I get around this?
source
share