Submit form

There are two ways for adding the submit button. First way, is using the <input> element with type="submit". Second way, is using the <button> also with type="submit".

attributes

You can override some form attributes using the corresponding formxxx attributes. For example, the action attribute will become the formaction attribute in the submit element.

attribute description
formaction The URL that handles the form action. Overrides the form's action attribute, if any.
formmethod The HTTP method of action. Possible values:
  • post - the POST method, form data sent as the request body
  • get - the GET method, form data appended to the action URL with a ? separator.
  • dialog - when the form is inside a <dialog>, closes the dialog on submission
formenctype The MIME type of the form submission for method post. Possible values:
  • application/x-www-form-urlencoded the default value
  • multipart/form-data used for uploading files
  • text/plain used for debugging purposes
formtarget

Specifies where to display the response after submitting the form. Possible values:

  • _self - load into the same browsing context as the current one.
  • _blank - load into a new unnamed browsing context.
  • _parent - load into the parent browsing context of the current one. If no parent, behaves the same as _self.
  • _top - load into the top-level browsing context. If no parent, behaves the same as _self.