How to Disable Browser Autocomplete in Convert Forms

Browser autocomplete can be both a blessing and a curse. While it helps users quickly fill out forms, there are times when you may want to disable this feature—especially when accuracy or security is critical. For example, you might want users to manually enter their details to avoid errors or protect sensitive information.

This article explains why disabling autocomplete can be useful and provides simple steps to turn it off for specific fields or entire forms in Convert Forms. We’ll also cover some important considerations to keep in mind.

Why Disable Browser Autocomplete?

Before we dive into the "how," let’s talk about the "why." Here are a few reasons you might want to disable autocomplete:

  1. Data Accuracy: Autocomplete can sometimes fill in incorrect or outdated information, leading to errors.
  2. Security Concerns: For sensitive fields like passwords or payment details, manual entry ensures better control over user input.
  3. User Experience: In some cases, you may want users to consciously engage with your form rather than relying on pre-filled data.

While disabling autocomplete is straightforward, it’s worth noting that not all browsers respect the autocomplete="off" attribute. 

Convert Forms Options

Disabling Autocomplete for Specific Fields

If you only need to disable autocomplete for certain fields (e.g., a password field or a custom input), follow these steps:

  1. Edit Your Form
    Open the form you’d like to modify in Convert Forms.
  2. Select the Field
    Click on the field where you want to disable autocomplete.
  3. Adjust Field Settings
    On the left-hand panel, look for the "Disable Browser Autocomplete" option. Enable this setting.
  4. Save Your Changes
    Once enabled, save the form. The selected field will no longer allow browsers to auto-fill data.

This method is ideal if you only need to target specific fields without affecting the entire form.

Disabling Autocomplete for an Entire Form

If you’d prefer to disable autocomplete for all fields in a form, you can achieve this by adding a small PHP snippet. Here’s how:

  1. Edit Your Form
    Open the form in Convert Forms.
  2. Navigate to PHP Scripts
    Go to Behavior → PHP Scripts → Form Display.
  3. Add the PHP Snippet
    Insert the following code into the provided text area:
    // Add autocomplete="off" to the form element
    $needle = '<form name="cf'.$form['id'].'"'; $replacement = $needle . ' autocomplete="off"'; $formLayout = str_replace($needle, $replacement, $formLayout);
  4. Save Your Form
    Save the changes. This snippet ensures that the autocomplete="off" attribute is applied to the entire form, preventing browsers from auto-filling any fields.

Important considerations

  • Browser Behavior: Modern browsers often prioritize user convenience over developer preferences. Even with autocomplete="off", some browsers may still auto-fill fields based on stored user data.
  • Sensitive Fields: For highly sensitive fields (like passwords), consider using autocomplete="new-password". This signals to the browser that the field requires fresh input rather than pre-filled data.
  • Testing Across Browsers: Always test your form in multiple browsers to ensure consistent behavior, as support for autocomplete attributes varies.

Final thoughts...

Disabling browser autocomplete is a simple yet powerful way to improve data accuracy and enhance security in your forms. Whether you’re targeting specific fields or an entire form, Convert Forms makes it easy to implement this feature. Just remember to account for browser quirks and test thoroughly to ensure the desired outcome.