I made an form in HTML and the autofill feature on Chrome successfully fills in the street address, city, and zip. If I leave the "state" input with type="text"
, then it gets autofilled successfully as well. However, if I use a select/option
dropdown list, then it does not get autofilled.
For the options, I tried using state abbreviations for the value like:
<label>
<select>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<select>
State
</label>
and I tried using the state name for the value:
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
And neither one works.
Is there a way to get Google Chrome's autofill to automatically select a state from a dropdown list when it is auto-filling the address?
Notes:
The :autofill CSS pseudo-class matches when an <input> element has its value autofilled by the browser. The class stops matching if the user edits the field.
<select autocomplete="state">
will work too
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