GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — HTMLFormElement: submit() method - Web APIs | MDN

HTMLFormElement: submit() method

Baseline
Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

  • See full compatibility
  • Learn more

The HTMLFormElement.submit() method submits a given <form>.

This method is similar, but not identical to, activating a form's submit <button>. When invoking this method directly, however:

  • No submit event is raised. In particular, the form's onsubmit event handler is not run.
  • Constraint validation is not triggered.

The HTMLFormElement.requestSubmit() method is identical to activating a form's submit <button> and does not have these differences.

A form control (such as a submit button) with a name or id of submit will mask the form's submit method. Trying to call myForm.submit(); throws an error "submit is not a function" because in this case submit refers to the form control which has a name or id of submit.

<input> with attribute type="submit" will not be submitted with the form when using HTMLFormElement.submit(), but it would be submitted when you do it with original HTML form submit.

Syntax

js
submit()

Parameters

None.

Return value

None (undefined).

Examples

js
document.forms["my-form"].submit();

Specifications

Specification
HTML
# dom-form-submit-dev

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on Apr 10, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.