Reputation: 71198
is there some fix for this
<form>
<input type="text" ...
</form>
hitting the enter key inside the textfield when there is no submit button inside doesn't submit the form, is there some fix for this ?
Upvotes: 3
Views: 685
Reputation: 11780
You could use the keyup event of jquery and if the key pressed is 13 (enter key code) then submit the form:
$('#input-id').keyup(function(e) {
if (e.keyCode == 13) {
$('#form-id').submit();
}
});
Upvotes: 2
Reputation: 7564
My suggestion is.. Create a submit button. If you do not want to show the submit button, then hide the button using CSS.
Upvotes: 6