Learn html - html tutorial - formaction attribute in html- html examples - html programs
- The formaction attribute specifies when a form is submitted where the form-data to be send.
- The form’s action attribute can be overrides the attribute.
- The formaction attribute is only used for input and buttons element with type=”submit”.
Syntax for formaction attribute in HTML:
<element type="submit" formaction="URL">
Difference between HTML 4.01 and HTML 5 for formaction Attribute:
HTML 4.01
- HTML 4 does not support formaction attribute.
HTML 5
- formaction attribute new in HTML 5.
Applies To:
formaction Attribute Value:
| Value |
Description |
| URL |
Specifies where to send the form data. |
Sample Coding for formaction Attribute in HTML:
Tryit<!DOCTYPE html>
<html>
<body>
<form action="demo_form.html">
First name:<input type="text" name="fname"><br><br>
Last name: <input type="text" name="lname"><br><br>
<input type="submit" value="Submit">
<input type="submit" formaction="demo_admin.html" value="Submit as admin">
</form>
</body>
</html>
Code Explanation for formaction Attribute in HTML:
- The action attribute specifies when the form is submitted then the form-data will be send to “demo_form.html”.
- The formaction attribute overrides the <form> tag`s action attribute, So this submit button submit the form-data to the “demo_admin.html”.
Output for formaction Attribute in HTML:
- The First name and the Last name will get the input of the person’s details.
- The Submit button used to submit the form-data as user.
- The Submit as admin button used to submit the form-data as admin.
- When user click “Submit” button that will be redirected to the “demo_form.html” and the submitted value will be passed through URL.
- When user click “Submit as admin” button that will be redirected to the “demo_admin.html” and the submitted value will be passed through URL.
Browser Support for formaction Attribute in HTML:
Related Searches to formaction Attribute in html
form action post
form action php
form action email
form action in html with parameters
form action javascript
form action empty
html form action javascript
form action django
html attributes
html tutorialshtml editor html code html form html tutorial html color html color codes html table html img html5 html code for website html and css html programs html website free html editor html5 tutorial wysiwyg html editor html tutorial pdf html converter php tutorial html example html tutorial css tutorial html css html tags html basics code html html online html mailto html lang html tags list