how to prevent enter key submitting form code example
Example 1: how to stop form from submitting on enter
<form ... onkeydown="return event.key != 'Enter';">
Example 2: prevent form submission on enter key
<form action="...">
<!-- Prevent implicit submission of the form -->
<button type="submit" disabled style="display: none" aria-hidden="true"></button>
<!-- ... -->
<button type="submit">Submit</button>
</form>