how to prevent enter to submit in form in html code example Example: how to stop form from submitting on enter <form ... onkeydown="return event.key != 'Enter';">