As I visit many new websites for the first time, I see that:
I couldn't find what piece of code differentiates the two cases. For my website, I am stuck with #2. I am trying to achieve #1, where user can just re-use emails entered in other websites.
I used some code like this:
<input type="email" name="email" id="frmEmailA" placeholder="[email protected]" required autocomplete="email">
If the autocomplete feature is enabled but still not working, try disabling the account sync feature in the You and Google tab as mentioned previously. Click on Turn off to the right of your name and email address. Then restart Google Chrome and enable sync again.
Turn on autocompletions: From the control panel, select the search engine you want to edit. Click Search features from the menu on the left and then click the Autocomplete tab. Click on the slider to set Enable autocomplete to On.
The solution is simple and working perfectly in all browsers. Add disabled and autocomplete="off" attribute to the form fields( name, age, etc.) On Page Load enable the fields after few miliseconds.
Chrome respects autocomplete=off only when there is at least one other input element in the form with any other autocomplete value. This will not work with password fields--those are handled very differently in Chrome.
It seems that you want to enable autocomplete
, but you have specified the wrong attribute.
SYNTAX:
Autocomplete="on | off"
In order to save the email address entered for the first time though, you need to have a form
tag with the attribute method="POST"
on it. It is also recommended to use the autocompletetype
attribute to help the browsers populate the forms more accurately.
NOTE: In some cases on older browsers you may also need to add an action if the form doesn't have one. action="javascript:void(0)"
works.
An example with autocomplete on and method="POST"
:
<form method="POST" action="javascript:void(0)">
<input type="email" name="email" id="frmEmailA" placeholder="[email protected]" required autocomplete="on" autocompletetype=”email”>
<input type="submit">
</form>
An example without autocomplete and method="POST"
:
<form>
<input type="email" name="email" id="frmEmailA" placeholder="[email protected]" required autocomplete="off">
<input type="submit">
</form>
See also How to trigger Autofill in Google Chrome?
Difference is in autocomplete
attribute of input
element.
Syntax : <input autocomplete="">
It allows the browser to automatically filled the input field based on the previously filled data.
Hence, In #1
value of autocomplete
attribute should be on
.
DEMO
E-mail: <input type="email" name="email" autocomplete="on">
In #2
value of autocomplete
attribute should be off
.
DEMO
E-mail: <input type="email" name="email" autocomplete="off">
The answers so far are wrong/outdated or incomplete.
Using autocomplete="email"
is perfectly valid. But the browsers do not handle it very well at the moment. In Firefox and Chrome, only the name
attribute is used for autocompletion. So you should stick with name="email"
.
If the Chrome user really wants to have a proper autocompletion for every type that autocomplete
supports, he/she has to fill out the Autofill settings. After these settings are filled, the autocompletion does not depend on the name
attribute anymore, but uses the type of autocomplete
. I.E. it will suggest the user's email address for fields with autocomplete="email"
.
So in order to have the best browser support, you should keep <input name="email" autocomplete="email" [...]>
. As soon as there has been at least one submitted form with name="email"
or prefilled Autofill settings, the browser should actually autocomplete your input field.
Further Resources:
For some websites, putting my cursor in the email field of signup form immediately shows me email options from what I had entered in other websites.
I cannot reproduce that on the latest Chrome on Mac OS X. You actually have to doubleclick the input for the autocompletion to show up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With