Support » Plugin: Contact Form 7 » Disable Contact Form 7 Autofill

  • Hello there,

    We’re having some issues trying to get the autocomplete:off (or autocomplete:false) functionality to work in a form we’re using (found by clicking the “share your Mersea memories…” button. We’re running version 5.1 of the plugin, but nothing seems to actually disable autofill on any of the browsers that we’ve tested. Any help?

    Thank you kindly,

    Jim

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • put autocomplete=”off” in the form tag.

    Thread Starter mackman

    (@mackman)

    That just adds the word “off” to the form field on the front end, unless we’re missing something?

    Thread Starter mackman

    (@mackman)

    Any update on this topic?

    It will not work in chrome browser because Chrome ignores “off” and “disable”

    A workaround would be to use: autocomplete:off or autocomplete:”off”. But that will autopoupulate with what is between the quotation marks.

    Example:
    [email* your-email autocomplete:off “example@something.com”]

    The field will then be populated with example@something.com

    or

    [email* your-email autocomplete:”off”]

    The filed will autopopulate with off.

    What you could also do is to target at users with accounts on your WordPress site and use.
    default:user_login = User’s login name
    default:user_email = User’s email address

    Example:
    [text* your-name default:user_display_name]
    [email* your-email default:user_email]

    More info here:
    https://contactform7.com/setting-default-values-to-the-logged-in-user/

    • This reply was modified 2 years, 3 months ago by rancuta.
    • This reply was modified 2 years, 3 months ago by rancuta.

    Add custom attributes autocomplete="both" autocomplete="off" with functions.php file.

    add_filter( 'wpcf7_form_elements', 'imp_wpcf7_form_elements' );
    function imp_wpcf7_form_elements( $content ) {
        $str_pos = strpos( $content, 'name="FirstName"' );
        $content = substr_replace( $content, ' autocomplete="both" autocomplete="off" ', $str_pos, 0 );
    
        $str_pos = strpos( $content, 'name="LastName"' );
        $content = substr_replace( $content, ' autocomplete="both" autocomplete="off" ', $str_pos, 0 );
    
        return $content;
    }

    Check solution here: https://wordpress.stackexchange.com/a/342515/91844

    Your question actually helped me with my question: Because I was searching for a function like autofill! 😀

    Hope you´ll find a solution soon!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Disable Contact Form 7 Autofill’ is closed to new replies.