Attributo di azione <form> HTML

❮ Tag HTML <modulo>

Esempio

Al momento dell'invio, invia i dati del modulo a un file chiamato "action_page.php" (per elaborare l'input):

<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>

Definizione e utilizzo

L' actionattributo specifica dove inviare i dati del modulo quando viene inviato un modulo.


Supporto browser

Attribute
action Yes Yes Yes Yes Yes

Sintassi

<form action="URL">

Valori di attributo

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 <modulo>