Controlling Form Completion
The following code disables the form element autocomplete attribute.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<form autocomplete="off" method="post" action="http://yourServer/form">
<input name="fave" /> <input name="name" />
<button>Submit Vote</button>
</form>
</body>
</html>
There are two allowed values for the autocomplete attribute: on and off. The on is the default value.
You can apply the autocomplete attribute to individual input elements.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<form autocomplete="off" method="post" action="http://yourServer/form">
<input autocomplete="on" name="fave" /> <input name="name" />
<button>Submit Vote</button>
</form>
</body>
</html>
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
form:
- <form> to get user input
- Using the base Element to Set a Destination for Form Data
- Configuring the HTTP method Attribute for Form element
- Configuring the Form Data Encoding
- Controlling Form Completion
- Specifying a Target for the Form Response
- Setting the Name of the Form
- Adding Labels to a Form
- Automatically Focusing on an input Element
- Disabling Individual input Elements
- Form Elements Outside the Form
Related: