Submit form with Enter key without submit button? [duplicate]

$("input").keypress(function(event) {
    if (event.which == 13) {
        event.preventDefault();
        $("form").submit();
    }
});

Leave a Comment