PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Radio Buttons De-Select After Completing Form Fields Using Auto-Comp

  1. The previously selected radio button options instantly clear the minute a form field is completed using the browser built in auto-complete data. If I manually enter the data it's fine but if I select anything from the browsers auto-complete it resets all radio buttons to blank/none selected. This is a real problem on a long form where the user won't notice this until they have attempted to submit the form and get the rejection/incomplete warning.

    Posted 11 years ago on Monday July 8, 2013 | Permalink
  2. This is a known issue in Google Chrome v27 and will be getting fixed on their v28 release. This is a browser specific issue. Please see discussion here:

    https://code.google.com/p/chromium/issues/detail?id=244645

    You can use this code in your theme's function.php file to disable autocomplete for one form:

    add_filter('gform_form_tag', 'form_tag_62', 10, 2);
    function form_tag_62($form_tag, $form){
        // apply to form 62 only
        if ($form['id'] == 62 ) {
            $form_tag = preg_replace("|action='|", "autocomplete='off' action='$url", $form_tag);
        }
        // return the form tag whether or not we modified it
        return $form_tag;
    }

    Change the 62 to your form ID. This will add the autocomplete='off' to the form tag. That code worked for me and prevented autofill options from appearing in the browser.

    Posted 11 years ago on Monday July 8, 2013 | Permalink

This topic has been resolved and has been closed to new replies.