An HTML form with two submit buttons, with different actions:
The formaction
attribute specifies the URL of the file that will process the input control when the form is submitted.
The formaction
attribute overrides the action
attribute of the <form>
element.
Note: The formaction
attribute is used with type="submit"
and type="image"
.
The numbers in the table specify the first browser version that fully supports the attribute.
<input formaction="URL">
Value | Description |
---|---|
URL | Specifies the URL of the file that will process the input control when the form is submitted.
Possible values:
|
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The formaction attribute</h1>
<form action="/action_page.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>
<input type="submit" value="Submit">
<input type="submit" formaction="/action_page2.php" value="Submit to another page">
</form>
</body>
</html>
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded by: | Admin |