• Resolved KevinCollins

    (@kevincollins)


    Friends,

    I’d like to request native support for setting the HTML autocomplete attribute on individual form fields in the builder.

    Use case:
    On a contact/inquiry form, I have fields for a parent’s name, email, and phone number. Browsers can autofill these from saved contact data — but only if the field has the correct autocomplete value (e.g., given-name, family-name, email, tel). Without it, the browser either skips autofill or guesses incorrectly.

    What I’m doing now:
    I’m working around this with a custom JavaScript snippet in a Custom HTML block that runs on DOMContentLoaded and sets autocomplete attributes by targeting fields by their name attribute. It works, but it’s fragile — if Forminator changes its field naming convention it breaks silently.

    Requested feature:
    In the field settings panel (the sidebar when editing a field), add an optional Autocomplete dropdown with common values:

    • off
    • name, given-name, family-name
    • email
    • tel
    • organization
    • street-address, postal-code
    • bday

    This would render as autocomplete="[value]" on the element, making Forminator forms friendlier for users with saved browser/password manager data — with zero custom code needed.

    Thanks for considering it!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter KevinCollins

    (@kevincollins)

    Workaround: Setting autocomplete attributes on Forminator fields via JavaScript

    Problem:
    Forminator does not support setting the HTML autocomplete attribute on form fields
    natively. Without it, browsers skip autofill or guess incorrectly.

    Solution:
    Add a Custom HTML block to the page containing the form, with the script below.
    It runs on DOMContentLoaded and sets the correct autocomplete values by targeting
    fields by their name attribute. A MutationObserver re-applies the attributes if
    Forminator re-renders any part of the form dynamically.

    Field name mapping used (adjust to match your form):
    name-2[first-name] -> given-name (Parent / Guardian first name)
    name-2[last-name] -> family-name (Parent / Guardian last name)
    name-1[first-name] -> off (Student first name — different person)
    name-1[last-name] -> off (Student last name — different person)
    email-1 -> email
    phone-1 -> tel

    — PASTE INTO CUSTOM HTML BLOCK —

    — END —

    Notes:

    • Place this Custom HTML block BEFORE the Forminator block on the page.
    • To add more fields, add entries to the map object using the field’s name
      attribute value (inspect the rendered input in browser DevTools to confirm).
    • Common autocomplete token reference:
      given-name, family-name, name
      email
      tel
      organization
      street-address, address-line1, address-line2
      postal-code
      bday
      off (disables autofill for that field)
    • See full spec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @kevincollins

    Trust you are doing well today.

    We already optimized the Forminator fields for autocomplete, in version 1.48 we updated the attribute to make sure it is compatible with new browsers.

    The fields are like this for autocomplete attribute, some fields, like phone and date, are disabled for default since we had some issues reported with auto complete.

    Field
    
    Autofill Label
    
    Name - Single
    
    name
    
    Name - Prefix
    
    honorific-prefix
    
    Name - First Name
    
    given-name
    
    Name - Middle Name
    
    additional-name
    
    Name - Last Name
    
    family-name
    
    Email Address
    
    email

    Can you confirm if you are using the latest version of Forminator?

    Best Regards
    Amin

    Thread Starter KevinCollins

    (@kevincollins)

    Hi Amin, thanks for the detailed breakdown!

    Good news — I just confirmed that name fields (given-name, family-name) and email are all working with native autocomplete as expected. That covers most of our form.

    The remaining gap: phone field (tel) autocomplete

    On a contact/inquiry form, tel autofill is arguably the most useful — it's the field users are most likely to have saved in their browser or password manager, and it's the one they're most likely to mistype.

    Our specific request is:

    Add a per-field toggle in the builder to enable/disable autocomplete on the phone field (and date, if the same issue applies).

    We understand you disabled it by default due to reported issues — but those issues may not affect all use cases. Disabling globally with no override means every site has to work around it in JavaScript, which is fragile.

    Even a simple checkbox — "Enable browser autofill for this field (advanced)" — would be enough. The site owner can accept any browser-specific quirks on their own form.

    Our current workaround (for anyone else hitting this):

    document.addEventListener('DOMContentLoaded', function() {
    var el = document.querySelector('input[name="phone-1"]');
    if (el) el.setAttribute('autocomplete', 'tel');
    });

    This works, but breaks silently if Forminator changes its field naming convention.

    Thanks again for looking into this!
    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @kevincollins

    Add a per-field toggle in the builder to enable/disable autocomplete on the phone field (and date, if the same issue applies).

    To add further to what Amin mentioned in his previous reply, Autocomplete can be enabled on the Phone field by naviagting to the field settings as shown in the screenshot here: https://monosnap.ai/file/pMHkafUXd0wXBdyFVzKO6192EMuNjG Could you please confirm if you’ve tried that already?

    Along with that, about the date field, we had noticed reports about the autofill overriding the calendar on the datepicker field. However, I am still confirming about this with the Forminator team and shall update you on it soon.

    Kind Regards,
    Saurabh

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @kevincollins,

    We have an update from the Forminator team regarding Autofill on datepicker. This was removed because it was causing UX issues. However, you can change this using the forminator_field_date_markup filter.

    Please feel free to get back to us if you need any further clarification on this.

    That being said, can you please confirm that you have tried the Autocomplete option in the Phone field that Saurabh mentioned in the above response?

    Best Regards,
    Nebu John

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @kevincollins,

    Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to re-open this thread if you need any further assistance.

    Kind Regards,

    Nithin

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.