Vlad typically html forms have a name attribute, like "email", "first name", "address1" etc, that are pretty standard.
You can use either Field Attributes & Name Detection
Modern web forms use standard name attributes, such as:
name="email"
name="address"
name="firstName"
Your browser can map these to stored user data.
- Detect Input Type & Label Associations
Many websites follow semantic form designs:
<input type="email"> โ Autofill with the stored email.
<input type="tel"> โ Autofill with the stored phone number.
Use <label for="id"> associations to infer the field purpose.
- Or you can leverage the new autocomplete feature of html5:
<input type="text" name="street-address" autocomplete="address-line1">
<input type="text" name="city" autocomplete="address-level2">
Your autofill system should recognize these standard values and save them in some type of safe browser storage.