Atributo de formação HTML <input >
Exemplo
Um formulário HTML com dois botões de envio, com ações diferentes:
<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>
Definição e uso
O formaction
atributo especifica a URL do arquivo que processará o controle de entrada quando o formulário for enviado.
O formaction
atributo substitui o action
atributo do
<form>
elemento.
Nota: O formaction
atributo é usado com
type="submit"
e type="image"
.
Suporte ao navegador
Os números na tabela especificam a primeira versão do navegador que suporta totalmente o atributo.
Attribute | |||||
---|---|---|---|---|---|
formaction | Yes | 10.0 | Yes | 5.1 | 10.6 |
Sintaxe
<input formaction="URL">
Valores de atributo
Value | Description |
---|---|
URL | Specifies the URL of the file that will process the input control when the form is submitted. Possible values:
|
❮ Tag HTML <input>