Workflow Short – Disable Input Field Autocomplete (Google Chrome)

As I was presenting a project-in-development to a customer, the remark was made that “the suggested responses are going to be a problem, as this may be used on a community kiosk”.  I was presenting a self-service password reset project and demoing with Google Chrome.

So after a bit of looking around, I put together this bit of javascript code to disable the autocomplete suggestions in Chrome:


//remember to paste into notepad (or similar)
//before pasting into the Advanced Text Creator
//in Workflow in order to remove formatting from the text.

function DisableAutoComplete() {
var thisForm = document.getElementById('form1');
thisForm.setAttribute('autocomplete','off');
}

This is called at body onload like this:


DisableAutoComplete();

The feature we’re disabling is illustrated below.  It includes the dropdown list of values as well as the yellow background after one of the items is selected.

2015-01-20_19-46-02

Here’s a moving picture to demonstrate two different forms; one with autocomplete in its default state, and another with it disabled by our code above.

AutocompleteDisabled

Head over to the Demos page to find an example package.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s