Formulir pelengkapan otomatis Properti
Contoh
Setel pelengkapan otomatis ke nonaktif:
document.getElementById("myForm").autocomplete = "off";
Definisi dan Penggunaan
Properti pelengkapan otomatis menyetel atau mengembalikan nilai atribut pelengkapan otomatis dalam formulir.
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.
Tip: Di beberapa browser Anda mungkin perlu mengaktifkan fungsi pelengkapan otomatis agar ini berfungsi (Lihat di bawah "Preferensi" di menu browser).
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
autocomplete | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti pelengkapan otomatis:
formObject.autocomplete
Setel properti pelengkapan otomatis:
formObject.autocomplete = on|off
Nilai properti
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 |
Detail Teknis
Nilai Kembali: | Sebuah String, mewakili status pelengkapan otomatis |
---|
Lebih Banyak Contoh
Contoh
Kembalikan status pelengkapan otomatis:
var x = document.getElementById("myForm").autocomplete;
Halaman Terkait
Referensi HTML: HTML <form> atribut pelengkapan otomatis
Objek Bentuk