About This Script
Place the code at the bottom of this page inside the <head> section of your page. Then add the "disableReturn" class to any form on the page you wish for this to apply to.
Demo
Code
<!-- jQuery is required if you're not already using it -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Disable return provided by http://www.top-site-list.com -->
<script>
$(document).on('keydown', 'form.disableReturn :input:not(textarea)', function(e) {
if (e.which == 13) {
// Don't submit
e.preventDefault();
e.stopPropagation();
// And go to the next input
var inputs = $(this).closest('form').find(':input');
inputs.eq(inputs.index(this) + 1).focus();
return false;
}
});
</script>
More scripts