Atribut pelengkapan otomatis HTML <form>
Contoh
Formulir dengan pelengkapan otomatis pada:
<form action="/action_page.php" method="get" autocomplete="on">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname"><br><br>
<label for="email">Email:</label>
<input type="text" id="email" name="email"><br><br>
<input
type="submit">
</form>
Definisi dan Penggunaan
Atribut autocomplete
menentukan apakah formulir harus memiliki pelengkapan otomatis aktif atau nonaktif.
Saat pelengkapan otomatis aktif, browser secara otomatis melengkapi nilai berdasarkan nilai yang telah dimasukkan pengguna sebelumnya.
Tip: Dimungkinkan untuk memiliki pelengkapan otomatis "aktif" untuk formulir, dan "nonaktif" untuk bidang input tertentu, atau sebaliknya.
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung atribut tersebut.
Attribute | |||||
---|---|---|---|---|---|
autocomplete | Yes | Yes | 4.0 | 5.2 | 15.0 |
Sintaksis
<form autocomplete="on|off">
Nilai Atribut
Value | Description |
---|---|
on | Default. The browser will automatically complete values based on values that the user has entered before |
off | The user must enter a value into each field for every use. The browser does not automatically complete entries |
tag <form> HTML