Why this code works with the alert line commented, but dont work when not commented?
I want block the form submit, but allow other functions on enter (example, do $.get() in other page). Sorry for my bad english.
$(document).ready(function() {
$('#txtPesquisaServidor').keydown(function(event){
if(event.keyCode == 13) {
//alert('enter!');
event.preventDefault();
return false;
}
});
});
I'm using Jquery 1.6.2.
EDIT: Done! The problem was the alert
https://jsfiddle.net/o0mkjnwk/1/