Turn off autocomplete | XM Community
Question

Turn off autocomplete

  • 10 November 2020
  • 3 replies
  • 133 views

Hello,
Please i want to turn off the autocomplete or autofill on a text entry question like city, name, client number,... for all browser.
Thank you.


3 replies

Userlevel 7
Badge +20

If this is nothing related to by default behavior of different browsers then you have the option "Autocomplete" selected for "text-entry" question which you can change by selecting any other option which available.
Below is the support page:
https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/question-types-guide/standard-content/autocomplete-questions-supplemental-data/#SettingUp

Indeed, it's related to by default behavior of the browser. I want to block the browser to autocomplete or autofill a questions like name, city,...
I trided to add a Javascript like :
Qualtrics.SurveyEngine.addOnReady(function()
{
autocomplete="off"
});
But it didn't work..

Userlevel 7
Badge +27

Hi there, if you still need, I was able to put this in place by following the recommendation mentioned in this stackoverflow thread. The top answer recommends trying to confuse the browser by naming input ids in a way that the browser won't attempt to autofill or by setting the autocomplete attribute to a value that the browser won't recognize as an autofillable field. I went with the 2nd option, setting autofill to "do-not-autofill" instead of "off" or "no". Try adding the below to the OnReady section of the Form Field question's JavaScript:
jQuery("#"+this.questionId+" input[type='text']").each(function() {
            jQuery(this).attr("autocomplete", "do-not-autofill");
          });
Adapted from here.

Leave a Reply