I have a input text and I apply it typeahead plugin for suggesting items, but when I press enter key on input text it submit form.
How can I prevent form submit using tw
The first answer didn't worked for me, maybe because of updating the typeahead plugin, but I did passed the problem by using the 'alternative' input created by typehead:
$(".twitter-typeahead > input").focus(function(){
//disable btn when focusing the input
$("#my_submit_button").prop('disabled', true);
}).blur(function(){
//enable btn when bluring the input
$("#my_submit_button").prop('disabled', false);
});