input formaction Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input

Description

The formaction attribute specifies the URL of the file that will process the input control when the form is submitted.

The formaction attribute overrides the action attribute of the <form> element.

The formaction attribute is used with type="submit" and type="image".

Attribute Values

Value Description
URL Specifies the URL of the file that will process the input control when the form is submitted.

An HTML form with two submit buttons, with different actions:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<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"><br>
  <input type="submit" formaction="/action_page2.php" value="Submit to another page">
</form><!--  www  .j  a va 2s  . c o m-->

</body>
</html>

Related Tutorials