HTML <input> formmethod Attribute

❮ HTML <input> tag

Example

<form action="action.php" method="post">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname">

  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname">

  <input type="submit" formmethod="get" value="Submit as get">
</form>

Meaning

The formmethod attribute indicates how form information should be transferred to the server using a particular HTTP method.

The formmethod attribute overrides the method attribute of the <form> element.

Notes:


Standard Syntax

HTML: <input formmethod="get|post">

XHTML: <input formmethod="get|post"/>



Browser Support




Status







Attribute Values

Value Description
get Appends the form-data to the URL
post Sends the form-data as an HTTP post transaction
❮ HTML <input> tag