I’ve got a form with a custom submit button (not an input[type=submit]). I want the form to submit on pressing enter which the function below does, but it also submits on pressing enter to select a item from a autocomplete dropdown. How do I prevent it from submitting when selecting a autocomplete option?
submitForm.delegate('input','submit',function(e){
if (e.keyCode === 13)
submitForm.trigger('submit');
});
Thanks
Put in a validation / completeness check
OR – revert back to a submit button for better semantics, what’s the reason for not using it?