Advertisement
Home Open Editor ❯

HTML <button> formmethod Attribute

Example

<form action="action-post.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <button type="submit" formmethod="post">Submit</button>
</form>

Try this code ❯

Meaning

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

Notes:


Standard Syntax

<button type="submit" 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