CF8 switch of autocomplete on form

How to disable autocomplete on a ChronoForms form.

Overview

The issue is that browsers may not respect a global autocomplete attribute on the form tag.
Add a JavaScript action to the form page that sets the autocomplete attribute to "off" for all form elements, or set the attribute individually on each input field.

Answered
ChronoForms v8
pi pimh 28 Nov, 2025

Hi Max, 

Is there a method to switch off the auto complete for a complete form? Normally you can put autocomplete="off" in the form tag as additional attribute. Is there a way to insert this. 

Kind regards, Pim 

Max_admin Max_admin 29 Nov, 2025
Answer

Hi Pim

a global autocomplete="off" on the form tag may or may not be respected by the browser, I think the following code inside a JavaScript view in your form page should auto add it:

document.addEventListener("DOMContentLoaded", function () {
    document.querySelectorAll("form").forEach(f => f.setAttribute("autocomplete", "off"));
    document.querySelectorAll("input, select, textarea").forEach(el => el.setAttribute("autocomplete", "off"));
});
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pi pimh 30 Nov, 2025
1 Likes

Hi Max,

Thanks will try later. For now I used individual input attributes. Most important fields should have it switched off for now. 

Kind regards, Pim

Post a Reply