Service Portal: Chrome Identifying Fields as Address Fields and Offering Autofill Values

jmiskey
Kilo Sage

So, many of our users have been experiencing a weird little glitch when completing Service Portal request forms using Google Chrome.  For some reason, Google Chrome thinks some fields are address fields, and as such when you click on them, it offers recent/saved autofill information.  This looks rather odd when filling out a fields that have nothing to do with addresses, and it offers autofill options like "New York".

It appears that the issue is with Google Chrome, and it can be rectified by turning off the "Save and file addresses" Autofill setting in Chrome settings.

However, what I am wondering is why Google Chrome thinks certain non-address fields are addresses, and is there anything we can do in ServiceNow to make sure that Google Chrome does not mistakenly identify them as address fields.  (I do not know if the Field Type has anything to do with it.  The current example I am looking at is a List Collector variable to a Reference table I have.  I do not know if it behaves like this only for List Collectors, or other Field Types as well.)

9 REPLIES 9

No, not really.  We just updated our Google Chrome settings.  It would be nice to do it at the ServiceNow level, but we are just handling that way currently.

Joe72
Tera Contributor

I just ran into this issue as well. After fooling around with dictionary attributes with no luck, I decided to look at the DOM instead. Although these elements already have the "autocomplete='off'" attribute, the browser auto-complete was still kicking in. I removed attributes until the browser stopped auto-completing and the wining (losing) attribute was "type='search'". This does not impact any autocomplete attributes you may have defined.

This client script resolves the issue: (assuming you have client globals turned on)

function onLoad() {
   //jQuery
   jQuery("input[type='search']").each(function(i) { jQuery(this).attr('type', ''); });
   //Straight JS
   document.querySelectorAll(`[type="search"]`).forEach(function(el) { el.setAttribute('type', ''); })
}

You could individually target the field inputs as well if you didn't want to run this for every reference input.

Mark_Didrikson
ServiceNow Employee
ServiceNow Employee

Hi Joe,

I am receiving an error when I try to use this script. The error is: TypeError: jQuery is not a function

Do you know how I can resolve this?

Thanks!

Mark

Hey Mark,

That usually happens because client global objects are being blocked. You can check the KB article I linked above for more info. You'll need to add a system property to allow your client scripts access to them. You may need to add a system property for each scoped app that needs to access the client globals as well. 

Alternatively, just slap a "this" in front of jQuery.

Mark_Didrikson
ServiceNow Employee
ServiceNow Employee

Thanks Joe. Adding "this" got me past the error.

We are seeing some String fields on our Catalog Item form for entering first name, last name, etc. that Chrome is allowing a user to autofill with values they have used in the past. Do you know if there is a way we can prevent this?

Thanks for your help!

Mark

 

find_real_file.png