---
id: api/commands/submit
title: submit | Cypress Documentation
description: Submit a form in Cypress.
section: api
source_path: docs/api/commands/submit.mdx
version: fa8f60eba6ec9a949b75fe9f9f5f6591719cd01f
updated_at: '2026-05-05T21:21:10.048Z'
---
# submit

Submit a form.

It is [unsafe](/llm/markdown/app/core-concepts/retry-ability.md#Only-queries-are-retried) to chain further commands that rely on the subject after `.submit()`.

The [subject](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management) must be a `<form>`.

## Syntax

```
.submit().submit(options)
```

### Usage

**Correct Usage**

```
cy.get('form').submit() // Submit a form
```

**Incorrect Usage**

```
cy.submit() // Errors, cannot be chained off 'cy'cy.get('input').submit() // Errors, 'input' does not yield a form
```

### Arguments

**options _(Object)_**

Pass in an options object to change the default behavior of `.submit()`.

| Option | Default | Description |
| --- | --- | --- |
| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |
| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.submit()` to resolve before [timing out](#Timeouts) |

### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)

*   `.submit()` yields the same subject it was given.
*   It is [unsafe](/llm/markdown/app/core-concepts/retry-ability.md#Only-queries-are-retried) to chain further commands that rely on the subject after `.submit()`.

## Example

### No Args

#### Submit can only be called on a single form

```
<form id="contact">  <input type="text" name="message" />  <button type="submit">Send</button></form>
```

```
cy.get('#contact').submit()
```

## Notes

### Submit is not an action command

`.submit()` is not implemented like other action commands, and does not follow the same rules of [waiting for actionability](/llm/markdown/app/core-concepts/interacting-with-elements.md).

`.submit()` is a helpful command used as a shortcut. Normally a user has to perform a different "action" to submit a form. It could be clicking a submit `<button>`, or pressing `enter` on a keyboard.

Oftentimes using `.submit()` directly is more concise and conveys what you're trying to test.

If you want the other guarantees of waiting for an element to become actionable, you should use a different command like [`.click()`](/llm/markdown/api/commands/click.md) or [`.type()`](/llm/markdown/api/commands/type.md).

### Submit will fail if there are form validation errors

If the form being submitted includes inputs with [client-side validation](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation) and that validation fails, `.submit()` will fail and list the validation failures.

## Rules

### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)

*   `.submit()` requires being chained off a command that yields DOM element(s).
*   `.submit()` requires the element to be a `form`.

### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)

*   `.submit()` will automatically wait for assertions you have chained to pass.

### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)

*   `.submit()` can time out waiting for assertions you've added to pass.

## Command Log

**_Submit a form_**

```
cy.intercept('POST', '/users', { fixture: 'user' }).as('userSuccess')cy.get('form').submit()
```

The commands above will display in the Command Log as:

When clicking on `submit` within the command log, the console outputs the following:

## History

| Version | Changes |
| --- | --- |
| [< 0.3.3](/llm/markdown/app/references/changelog.md#0-3-3) | `.submit()` command added |

## See also

*   [`.click()`](/llm/markdown/api/commands/click.md)
*   [`.type()`](/llm/markdown/api/commands/type.md)
