Atributo de ação HTML <form>

❮ Tag HTML <form>

Exemplo

Ao enviar, envie os dados do formulário para um arquivo chamado "action_page.php" (para processar a entrada):

<form action="/action_page.php" method="get">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="submit" value="Submit">
</form>

Definição e uso

O actionatributo especifica para onde enviar os dados do formulário quando um formulário é enviado.


Suporte ao navegador

Attribute
action Yes Yes Yes Yes Yes

Sintaxe

<form action="URL">

Valores de atributo

Value Description
URL Where to send the form-data when the form is submitted.

Possible values:

  • An absolute URL - points to another web site (like action="http://www.example.com/example.htm")
  • A relative URL - points to a file within a web site (like action="example.htm")

❮ Tag HTML <form>