### [How to Stop the Enter Key From Submitting the Form](https://wpforms.com/developers/how-to-stop-the-enter-key-from-submitting-the-form/)

**Published:** February 2, 2021
**Author:** Editorial Team

**Excerpt:** This article will help walk you through how to stop the enter key from submitting your forms. This includes navigating through the fields as well as the submit button. 

**Content:**

Would you like to stop the **Enter** key on your forms? There are many debates if you should or shouldn’t disable this key but if you’ve done your research and have determined it’s best for your site to disable this key, this article will give you the code necessary to disable the **Enter** key on your forms.

## Disabling the enter key

To disable this key on your forms, which include the submit button, next/previous page buttons as well as using the enter key to navigate through the fields of the form, just copy this code and add it to your site.

If you need any assistance with how and where to add snippets to your site, [please check out this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

Please note that this code **will not work** for **Conversational Forms**.

We need to place the numerical number that represents the **Enter** key on a standard keyboard. we already know that this is represented by the number **13** if you would like to find out more about these numbers and what they represent, [take a look at this documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values "Mozilla Developer Documentation on Key Values").

#### For a specific WPForms form

```

/**
 * Disable the Enter key on a specific form 
 *
 * @link https://wpforms.com/developers/how-to-stop-the-enter-key-from-submitting-the-form/
 */

function wpf_dev_disable_enter_specific_form( ) {
?>

**Categories:** Extending

**Tags:** Javascript, jQuery, JS

---

