---
title: "Enter Key to submit forms - how to stop"
slug: "survey-stop-enter-key-submitting-the-form"
updated: 2025-07-22T00:08:20Z
published: 2025-07-22T00:08:20Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.infoodle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enter Key to submit forms - how to stop

There may be times when you want to stop form users from submitting the form when selecting the **Enter** key - which is the default behaviour of your browser. 

This situation arose when a client had produced a multi-page survey form and users were selecting **ENTER** to proceed to the next page instead of clicking on the **Next** button.

To achieve this change copy the following Javascript and past into the **Form Settings > Appearance** field.

```
</style>
<script>
//place your javascript code here

document.addEventListener("DOMContentLoaded", function () {
  const form = document.querySelector("form");
  form.addEventListener("keydown", function (e) {
    if (e.key === "Enter") {
      e.preventDefault();
    }
  });
});

</script>
<style>
```

## Related

- [Forms](/forms.md)
- [Altering the Design of a Form - CSS & Javascript](/altering-the-design-of-a-form-css-javascript.md)
