Reputation: 24077
I'm building a site locally and in one form I have a phone number input and a password input. Chrome is pre-filling these fields, the phone number with my email address, and the password field with a password as shown.
This is a registration page so I don't want the password field pre-filled and the phone number should not contain an email address.
This is the markup of these inputs:
<input type="tel" value="" id="phone" name="phone" class="input ">
<input type="password" placeholder="Min 10 characters" id="password" name="password" class="input ">
Things I have tried to disable chrome autocomplete, all of which have had no effect:
autocomplete="off"
/autocomplete="false"
to both the inputs themselves and the outer form element.The only thing that prevents chrome autocompleting the input is to add another phone
input before and style it as hidden, which is a horrible hack I want to avoid.
What is the cause of chrome inserting an email address into a tel
input with name phone
? How can I prevent this behaviour?
I'm not worried about completely disabling autocomplete but I don't want it inserting email addresses into phone-number inputs.
Upvotes: 0
Views: 117
Reputation: 215
Note: email addresses has been filled in the phone number input field instead of phone number.
Upvotes: 1