HTML-<form > -Aktionsattribut

❮ HTML <form>-Tag

Beispiel

Senden Sie beim Absenden die Formulardaten an eine Datei namens "action_page.php" (um die Eingabe zu verarbeiten):

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

Definition und Verwendung

Das actionAttribut gibt an, wohin die Formulardaten gesendet werden, wenn ein Formular gesendet wird.


Browser-Unterstützung

Attribute
action Yes Yes Yes Yes Yes

Syntax

<form action="URL">

Attributwerte

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

❮ HTML <form>-Tag