{
  "doc": {
    "id": "api/commands/submit",
    "title": "submit | Cypress Documentation",
    "description": "Submit a form in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/submit.md",
    "version": "e6988a974973e9090ce70406c38cb2b9e0eac9fa",
    "updated_at": "2026-05-15T15:50:22.536Z",
    "headings": [
      {
        "id": "api/commands/submit#submit",
        "text": "submit",
        "level": 1
      },
      {
        "id": "api/commands/submit#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/submit#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/submit#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/submit#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/submit#example",
        "text": "Example",
        "level": 2
      },
      {
        "id": "api/commands/submit#no-args",
        "text": "No Args",
        "level": 3
      },
      {
        "id": "api/commands/submit#submit-can-only-be-called-on-a-single-form",
        "text": "Submit can only be called on a single form",
        "level": 4
      },
      {
        "id": "api/commands/submit#notes",
        "text": "Notes",
        "level": 2
      },
      {
        "id": "api/commands/submit#submit-is-not-an-action-command",
        "text": "Submit is not an action command",
        "level": 3
      },
      {
        "id": "api/commands/submit#submit-will-fail-if-there-are-form-validation-errors",
        "text": "Submit will fail if there are form validation errors",
        "level": 3
      },
      {
        "id": "api/commands/submit#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/submit#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/submit#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/submit#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/submit#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/submit#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/commands/submit#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/submit#syntax",
      "doc_id": "api/commands/submit",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n.submit().submit(options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\ncy.get('form').submit() // Submit a form\n```\n\n**Incorrect Usage**\n\n```\ncy.submit() // Errors, cannot be chained off 'cy'cy.get('input').submit() // Errors, 'input' does not yield a form\n```\n\n### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.submit()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.submit()` to resolve before [timing out](#Timeouts) |\n\n### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.submit()` yields the same subject it was given.\n*   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()`.\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 167
    },
    {
      "id": "api/commands/submit#usage",
      "doc_id": "api/commands/submit",
      "heading": "Usage",
      "heading_level": 3,
      "content_markdown": "### Usage\n\n**Correct Usage**\n\n```\ncy.get('form').submit() // Submit a form\n```\n\n**Incorrect Usage**\n\n```\ncy.submit() // Errors, cannot be chained off 'cy'cy.get('input').submit() // Errors, 'input' does not yield a form\n```\n",
      "section": "api",
      "anchors": [
        "usage"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 41
    },
    {
      "id": "api/commands/submit#arguments",
      "doc_id": "api/commands/submit",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `.submit()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`defaultCommandTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `.submit()` to resolve before [timing out](#Timeouts) |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 79
    },
    {
      "id": "api/commands/submit#yields-learn-about-subject-management",
      "doc_id": "api/commands/submit",
      "heading": "Yields Learn about subject management",
      "heading_level": 3,
      "content_markdown": "### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n*   `.submit()` yields the same subject it was given.\n*   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()`.\n",
      "section": "api",
      "anchors": [
        "yields-learn-about-subject-management"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 40
    },
    {
      "id": "api/commands/submit#notes",
      "doc_id": "api/commands/submit",
      "heading": "Notes",
      "heading_level": 2,
      "content_markdown": "## Notes\n\n### Submit is not an action command\n\n`.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).\n\n`.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.\n\nOftentimes using `.submit()` directly is more concise and conveys what you're trying to test.\n\nIf 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).\n\n### Submit will fail if there are form validation errors\n\nIf 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.\n",
      "section": "api",
      "anchors": [
        "notes"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 177
    },
    {
      "id": "api/commands/submit#submit-is-not-an-action-command",
      "doc_id": "api/commands/submit",
      "heading": "Submit is not an action command",
      "heading_level": 3,
      "content_markdown": "### Submit is not an action command\n\n`.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).\n\n`.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.\n\nOftentimes using `.submit()` directly is more concise and conveys what you're trying to test.\n\nIf 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).\n",
      "section": "api",
      "anchors": [
        "submit-is-not-an-action-command"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 132
    },
    {
      "id": "api/commands/submit#submit-will-fail-if-there-are-form-validation-errors",
      "doc_id": "api/commands/submit",
      "heading": "Submit will fail if there are form validation errors",
      "heading_level": 3,
      "content_markdown": "### Submit will fail if there are form validation errors\n\nIf 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.\n",
      "section": "api",
      "anchors": [
        "submit-will-fail-if-there-are-form-validation-errors"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 43
    },
    {
      "id": "api/commands/submit#rules",
      "doc_id": "api/commands/submit",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `.submit()` requires being chained off a command that yields DOM element(s).\n*   `.submit()` requires the element to be a `form`.\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `.submit()` will automatically wait for assertions you have chained to pass.\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `.submit()` can time out waiting for assertions you've added to pass.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 84
    },
    {
      "id": "api/commands/submit#command-log",
      "doc_id": "api/commands/submit",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\n**_Submit a form_**\n\n```\ncy.intercept('POST', '/users', { fixture: 'user' }).as('userSuccess')cy.get('form').submit()\n```\n\nThe commands above will display in the Command Log as:\n\nWhen clicking on `submit` within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/submit.json",
      "token_estimate": 49
    }
  ]
}