The formmethod Attribute

The formmethod Attribute

//the second submit button overrides the HTTP method of the form:

<form action="/action_page.php" method="get">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
  <input type="submit" formmethod="post" value="Submit using POST">
</form>
  • Defines the HTTP method for sending form-data to the action URL.
  • Overrides the method attribute of the <form> element.
  • Can be used with type="submit" and type="image".

The formmethod Attribute — Structure map

Clickable & Draggable!

The formmethod Attribute — Related pages: