HTML <input> formation Atribut

❮ HTML tag <input>

Příklad

HTML formulář se dvěma tlačítky pro odeslání s různými akcemi:

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

Definice a použití

Atribut formactionurčuje adresu URL souboru, který zpracuje vstupní ovládací prvek při odeslání formuláře.

Atribut formactionpřepíše actionatribut <form>prvku.

Poznámka: Atribut formactionse používá s type="submit"a type="image".


Podpora prohlížeče

Čísla v tabulce určují první verzi prohlížeče, která tento atribut plně podporuje.

Attribute
formaction Yes 10.0 Yes 5.1 10.6

Syntax

<input formaction="URL">

Hodnoty atributů

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

❮ HTML tag <input>