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 twitter bootstrap typeahead plugin?
You can target that specific input by adding an ID to it and simply removing the keydown event for enter like so:
JS
$(document).ready(function() {
$('form input').keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
return false;
}
});
});