Attributo di formazione <input> HTML

❮ Tag HTML <input>

Esempio

Un modulo HTML con due pulsanti di invio, con diverse azioni:

<form action="/action_page.php">
  <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">
  <input type="submit" formaction="/action_page2.php" value="Submit to another page">
</form>

Definizione e utilizzo

L' formactionattributo specifica l'URL del file che elaborerà il controllo di input quando il modulo viene inviato.

L' formactionattributo sovrascrive l' actionattributo <form>dell'elemento.

Nota: l' formactionattributo viene utilizzato con type="submit"e type="image".


Supporto del browser

I numeri nella tabella specificano la prima versione del browser che supporta completamente l'attributo.

Attribute
formaction Yes 10.0 Yes 5.1 10.6

Sintassi

<input formaction="URL">

Valori di attributo

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

Possible values:

  • An absolute URL - the full address of a page (like href="http://www.example.com/formresult.asp")
  • A relative URL - points to a file within the current site (like href="formresult.asp")

❮ Tag HTML <input>