English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The formaction attribute specifies the URL of the file that will handle the input controls when the form is submitted, the formaction attribute will override the action attribute of the <form> element.
An HTML form with two submit buttons (can be submitted to different actions):
<!DOCTYPE html> <html> <head> <title>HTML: <input> formaction attribute - Basic Tutorial Website(oldtoolbag.com)</title> <body> <form action="action_page.php"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="Submit to action_page1><br> <input type="submit" formaction="action_page2.php" value="Submit to action_page2"> </form> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 10Firefox, Opera, Chrome, and Safari all support the formaction attribute.
Note:Internet Explorer 9 and earlier versions do not support the formaction attribute of the <input> tag.
The formaction attribute specifies the URL of the file to be processed when the form is submitted.
The formaction attribute overrides theactionattribute.
Note: The formaction attribute is used with type="submit" and type="image".
The formaction attribute is an HTML5 The new attribute added in
<input formaction="URL">
Value | Description |
---|---|
URL | Specifies the URL to be used for processing the input control file when the form is submitted. Possible values: Absolute URL - The complete address of a page (such as HREF = 'http:)//www.example.com/formresult.php”) Relative URL - Points to a file within the current website (such as HREF = 'formresult.php') |