Advertisement
Home Open Editor ❯

HTML <input> formmethod Attribute

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>

Try this code ❯

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"/>


Advertisement

Attribute Values

Value Description
get Appends the form-data to the URL
post Sends the form-data as an HTTP post transaction
Home Open Editor ❯
Advertisement