You are viewing limited content. For full access, please sign in.

Question

Question

Forms - Chrome Autofill replacing Lookup

asked on October 24, 2018

I have a client who has Forms relating to student records/information.  It uses a lookup to fill in student information, however, Chrome will autofill the user's information in place of the lookup.

 

From what I have found so far, you can only disable auto-fill in Chrome entirely, not for specific websites.  Turning off this feature in this case isn't viable as it is thousands of staff members using these forms.

 

Is there any way to disable this in the form or perhaps a workaround?  I haven't tested it yet, but my initial thought was to hide other fields until the lookup trigger field is filled and then have the rest appear.  Also, they cannot make the fields read only as in some cases the database may be missing information and non-staff submitters will be filling out the information by hand.

 

Anyone else run into this issue?

0 0

Answer

SELECTED ANSWER
replied on November 7, 2018

We were able to solve the issue with the following, which adds a fake autocomplete for all inputs.

$("input").attr("autocomplete", "fake-name-disable-autofill");

0 0
replied on May 21, 2022

Arg! So autofill has gotten aggressive lately. I don't think this is working anymore. This is the latest fix that "seems" to work. I tested it in Edge and Chrome and I got it from a Mozilla help page. I needed it for some new forms, but I was thinking you might need to patch it back into your volunteer form and a few others that are using the old code. 

My apologies if this code isn't formatted correctly. It works, but I'm not 100% certain on the proper way to write it. 

Have fun!

//This is for the whole page. 
$(document).ready(function () {

  $("input").attr("autocomplete", "new-password");
});

// This seems to work for just the fields I want when they are given the CSS of DoNotAutoFillPlease
$(document).ready(function () {

  $('.DoNotAutoFillPlease input').attr("autocomplete", "new-password");
});

 

0 0

Replies

replied on October 24, 2018

Theoretically, you could do something like this:

$(document).ready(function () {
  $("#q5 input").attr("autocomplete", "off");
});

However, it looks like Forms already has that attribute at the top level, so it should apply to all fields. Browsers tend to ignore that attribute when they think that the field is really important, like login information.

Can you attach a screenshot of what you are seeing?

0 0
replied on October 24, 2018

Per the user:

So what I think is happening is there is sometimes a short lag time between when the Student # is entered and the lookup performs to autofill the data.  In that short time, the submitter will enter in the Student#, then tab down to the next field and chrome reads “first name” and auto fills in the submitter’s information instead of the student’s.  Since the submitter is so used to the form being auto filled, they don’t notice that it’s the incorrect information.  Here is an example of what chrome is putting into the form.

In this instance it has made the submitter (Holly) the student, the submitter the parent notified and the supervisor.  The Supervisor is also a lookup field that is auto filled based on the location of the student, so that field is affected as well.

Inkedscreenshot_LI.jpg
Inkedscreenshot2_LI.jpg
0 0
replied on October 24, 2018

Can you try it in another browser? Chrome has the bad habit of ignoring the autocomplete attribute.

0 0
replied on November 6, 2018

The issue is that there are many users, both internal and external.  Would be difficult to try and force everyone on a different browser.

0 0
replied on November 6, 2018 Show version history

Understood. That's not my point. What I'm trying to get across is that true cross platform behavior isn't always feasible. Checking functionality in specific browsers is a troubleshooting step, not a solution. If the form works fine in other browsers, then at least you can narrow it down to something specific, and take steps to mitigate that issue.

One way to break auto fill features is to make sure that the underlying input controls are named something other than "firstname", etc. This makes it difficult for the browser to kick in it's auto fill.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.