Atributo de formación HTML <entrada>

❮ Etiqueta HTML <entrada>

Ejemplo

Un formulario HTML con dos botones de envío, con diferentes acciones:

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

Definición y uso

El formactionatributo especifica la URL del archivo que procesará el control de entrada cuando se envíe el formulario.

El formactionatributo anula el actionatributo del <form>elemento.

Nota: El formactionatributo se usa con type="submit"y type="image".


Compatibilidad con navegador

Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con el atributo.

Attribute
formaction Yes 10.0 Yes 5.1 10.6

Sintaxis

<input formaction="URL">

Valores de atributos

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

❮ Etiqueta HTML <entrada>