HTML <input> Formaction- Attribut
Beispiel
Ein HTML-Formular mit zwei Senden-Schaltflächen mit unterschiedlichen Aktionen:
<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>
Definition und Verwendung
Das formaction
Attribut gibt die URL der Datei an, die das Eingabesteuerelement verarbeitet, wenn das Formular gesendet wird.
Das formaction
Attribut überschreibt das action
Attribut des
<form>
Elements.
Hinweis: Das formaction
Attribut wird mit
type="submit"
und verwendet type="image"
.
Browser-Unterstützung
Die Zahlen in der Tabelle geben die erste Browserversion an, die das Attribut vollständig unterstützt.
Attribute | |||||
---|---|---|---|---|---|
formaction | Yes | 10.0 | Yes | 5.1 | 10.6 |
Syntax
<input formaction="URL">
Attributwerte
Value | Description |
---|---|
URL | Specifies the URL of the file that will process the input control when the form is submitted. Possible values:
|
❮ HTML <input>-Tag