HTML <form> autocomplete-eigenschap
Definitie en gebruik
autocomplete
De eigenschap bepaalt of het formulier de functie van automatische voltooiing moet inschakelen.
Wanneer de functie van automatische voltooiing is ingeschakeld, zal de browser automatisch de invoer voltooien op basis van de waarden die de gebruiker eerder heeft ingevoerd.
Tip: U kunt de functie van automatische voltooiing van het formulier inschakelen en de automatische voltooiing van specifieke invoervelden uitschakelen, en vice versa.
Voorbeeld
Formulier met automatische voltooiing inschakelen:
<form action="/action_page.php" method="get" autocomplete="on"> <label for="fname">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>
Syntax
<form autocomplete="on|off">
Attribute Value
Value | Description |
---|---|
on | Default. Browsers will automatically complete the input based on the user's previous input. |
off | Users must enter a value for each field each time they use it. Browsers will not automatically complete the input. |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | Supported | 4.0 | 5.2 | 15.0 |
Note: The autocomplete attribute is a new attribute in HTML5.