HTML CSS examples for HTML Tag:button
The formaction attribute specifies where to send the form-data when a form is submitted. This attribute overrides the form's action attribute.
The formaction attribute is only used for buttons with type="submit".
Value | Description |
---|---|
URL | Specifies where to send the form data. |
A form with two submit buttons. The first submit button submits the form data to "action_page.php", and the second submits to "action_page2.php":
<!DOCTYPE html> <html> <body> <form action="/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="/action_page2.php">Submit to another page</button> </form><!-- w ww . j a v a 2 s . co m--> </body> </html>