HTML <button> formaction Attribute
Example
<form action="action.php" method="get">
<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">Submit</button>
<button type="submit" formaction="action2.php">Submit to another link</button>
</form>
Meaning
The formaction attribute specifies a URL to target when the button is clicked, similar to the use of the action attribute on a form element.
Note: The formaction attribute is only used for buttons with type="submit".
Standard Syntax
<button type="submit" formaction="URL">
Advertisement
Attribute Values
| Value | Description |
|---|---|
| URL | Value can be
|