Last Updated : 11 Jul, 2025
The HTML formaction Attribute determines the submission destination of form data, overriding the form's default action. It's exclusively applied to input/buttons with type="submit".
Syntax< element formaction="URL">Supported Tags Attribute Values
It contains a single value URL which is used to specify the URL of the document where the data to be sent after submission of the form. The possible value of the URL is:
HTML formaction Attribute ExampleExample: In this example we demonstrates the formAction attribute, specifying the submission destination for form data, overriding the form's default action, set to "test.php".
HTML
<!DOCTYPE html>
<html>
<head>
<title>HTML formAction Attribute</title>
</head>
<body>
<h2>HTML formAction Attribute</h2>
<form action="#"
method="get"
target="_self">
<input type="text"
id="Geeks"
name="myGeeks"
value="geeksforgeeks"
formtarget="_blank"
formmethod="post"
formaction="test.php" />
<input type="submit" />
</form>
</body>
</html>
Output:
HTML formaction Attribute example output
Supported Browsers : The browsers supported by formaction Attribute are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4