I have an HTML form with a single submit input, but also various button elements. When the user presses the \'enter\' key, I\'d expect it to actually s
submit
button
You can use jQuery:
$(function() { $("form input").keypress(function (e) { if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { $('button[type=submit] .default').click(); return false; } else { return true; } }); });