

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use formaction attribute in HTML?
The formaction attribute works when let’s say you have two submit buttons in your form and you want both the buttons to work separately. Both the buttons send data to different pages. The formaction attribute overrides the form action attribute.
Note − The formaction attribute is not supported in Internet Explorer 9 and earlier versions.
Example
You can try to run the following code to learn how to use formaction attribute in HTML −
<!DOCTYPE html> <html> <head> <title>HTML formaction attribute</title> </head> <body> <form action = "/new1.php" method = "get"> Student name: <input type = "text" name = "name"><br> Student Subject: <input type = "text" name = "subject"><br> <button type = "submit">Submit</button><br> <button type = "submit" formaction = "/new2.php">Another page</button> </form> </body> </html>
- Related Questions & Answers
- How to use autocomplete attribute in HTML?
- How to use formnovalidate attribute in HTML?
- How to use formenctype attribute in HTML?
- How to use formtarget attribute in HTML?
- How to use list attribute in HTML?
- How to use multiple attribute in HTML?
- How to use pattern attribute in HTML?
- How to use placeholder attribute in HTML?
- How to use step attribute in HTML?
- How to use href attribute in HTML Page?
- How to use a novalidate attribute in HTML?
- How to use the formmethod attribute in HTML?
- How to use the required attribute in HTML?
- HTML DOM Input Submit formAction property
- How to use image height and width attribute in HTML Page?
Advertisements