Disabling Browser Autocomplete for Form Fields

Would you like to stop browsers from automatically filling in your form fields in Convert Forms? While autocomplete can be useful, there are situations where you may want users to input their details manually.

This guide explains disabling autocomplete for specific fields or entire forms using built-in options and PHP snippets.

Before disabling autocomplete, keep in mind:

  • Browsers often prioritize user settings over HTML attributes and JavaScript.
  • The autocomplete="off" attribute indicates your preference, though browsers may not always follow it.
  • Support for this feature varies across different browsers (refer to the MDN compatibility chart).

Disable Autocomplete for Specific Fields

Each form field has an option called "Disable Browser Autocomplete" in the field settings. Simply enable this option, and the browser will not auto-fill the field.

disable form field autocomplete

  1. Edit your form.
  2. Select the field where you want to disable autocomplete.
  3. In the field settings at the left, look for the Disable Browser Autocomplete option.
  4. Enable it and save the form.

Disable Autocomplete for All Fields in a Form

If you want to disable autocomplete for the entire form, apply a PHP snippet in the PHP Scripts → Form Display option.

  1. Edit your form.
  2. Navigate to Behavior -> PHP ScriptsForm Display.
  3. Insert the following PHP snippet:
$needle = '<form name="cf'.$form['id'].'"';
$replacement = $needle . ' autocomplete="off"';
$formLayout = str_replace($needle, $replacement, $formLayout);

This ensures that all fields within the form are marked with autocomplete="off", preventing browsers from auto-filling user data.

Notes

  • Depending on user preferences and stored autofill data, some browsers may still override this setting.
  • If autocomplete persists, consider adding autocomplete="new-password" to sensitive fields.
Last updated on Feb 4th 2025 09:02