English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The formaction attribute specifies where the form data is sent when the form is submitted. This attribute overrides the form's action attribute. The formaction attribute is only used for buttons of type "submit".
A form with two submit buttons, the first submit button submits the form data to "action_page.php", and the second submits to "action_page"2.php":
<!DOCTYPE html> <html> <head> <title>HTML:<button> formaction attribute - Basic Tutorial Web oldtoolbag.com</title> <body> <form action="/run/action_page.php" method="get"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <button type="submit">Submit</button><br> <button type="submit" formaction="/run/action_page2.php">Submit to another page</button> </form> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 10Firefox, Opera, Chrome, and Safari support the formaction attribute.
Note: Internet Explorer 9 and earlier IE versions do not support the formaction attribute.
The formaction attribute specifies where the form data will be sent when the form is submitted. This attribute will override the form's action attribute.
The formaction attribute is only used for buttons of type "submit".
This attribute is used in conjunction with type="submit".
The formaction attribute is an HTML 5 new attribute.
<button type="submit" formaction="URL">
Value | Description |
---|---|
URL | Specifies the address to which the form data will be sent. Possible values:
|