Atribut formasi HTML <input>
Contoh
Formulir HTML dengan dua tombol kirim, dengan tindakan berbeda:
<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>
Definisi dan Penggunaan
Atribut formaction
menentukan URL file yang akan memproses kontrol input saat formulir dikirimkan.
Atribut formaction
menimpa action
atribut
<form>
elemen.
Catatan: Atribut formaction
digunakan dengan
type="submit"
dan type="image"
.
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung atribut tersebut.
Attribute | |||||
---|---|---|---|---|---|
formaction | Yes | 10.0 | Yes | 5.1 | 10.6 |
Sintaksis
<input formaction="URL">
Nilai Atribut
Value | Description |
---|---|
URL | Specifies the URL of the file that will process the input control when the form is submitted. Possible values:
|
tag <input> HTML