While this question is old, I think it might be worth pointing out a better option that doesn’t rely on JavaScript.
HTML5 introduced form as an attribute that can be applied to any form control and will bind it to a specific form based on its id – even if the control isn’t nested inside the form tag.
Example:
<form id="my_sample_form">
...
</form>
<input type="submit" value="Submit" form="my_sample_form">
This submit button will submit the form with the id specified in its form attribute.
Furthermore this isn’t limited to submit buttons, but instead works for any form control and allows you to submit form partials that are positioned all over the place.
In contrast to most JavaScript solutions, you will keep all native form features like submitting on enter/return.