Disable autocomplete on forms

1
0
-1

Hi all,

Just a little question
Do you know how to disable automcomplete on all widgets or on all forms ?

Thanks a lot.

Comments

Submitted by delphine.coille... on Fri, 02/01/2019 - 10:30

Hi Fabien, Are you talking about the autocompletion of your browser? Which types of widgets are you using?

Indeed Bonita UI Designer widgets used in forms do not handle autocompletion, except for one specific widget called "autocomplete"

Thanks for your precision

Submitted by fabien.delannoy on Tue, 02/05/2019 - 08:36

Hi,
Thanks for your answer.
I talked about the autocompletion of browsers within the input widgets (except the autocomplete widget of course).

We'd like to have the <input autocomplete="off"></input> or <form autocomplete="off"><form> in forms.

We've tried to implement a jquey function to dynamically put this attribute on inputs but whithout success in living application.

Thanks a lot.

2 answers

1
0
-1

Hello,

in addition of the first response,

the option to create a "JavaScript Expression" containning:

document.getElementsByClassName("myForm")[0].setAttribute("autoComplete", "off");

looks to work for the latest web browser.

If you are able to test it.

Julien.

Comments

Submitted by fabien.delannoy on Tue, 02/19/2019 - 10:26

Thanks for your answers.

Where to call this command, because it seems to work in the browser's console, but not in an asset ?

Submitted by julien.mege on Tue, 02/19/2019 - 15:08

As the asset is a JS called at the begining of the page load, maybe it won't found any Element?

As a work around, the less uggly solution would be:

- to had this code insside a UID "JavaScript Expression" named "disableAutoComplete".

document.getElementsByClassName("myForm")[0].setAttribute("autoComplete", "off");

return false;

- Then you need to use this "disableAutoComplete" expression insside the "FORM CONTAINER > Hidden " field

it would do the job,

We already add an item in the roadmap to manage this use case out of the box.

thx,

Julien.

Submitted by fabien.delannoy on Wed, 02/20/2019 - 15:14

I tried your workaround without success.
Tried in a text widget or in an input widget, inside my form but still the issue.

I've got an error : Error evaluating < disableAutoComplete > data: Cannot read property 'setAttribute' of undefined

It seems the object isn't known when evaluating the variable.
When you click on the DOM object then execute the expression in console, it works... but not when calling into a variable.

1
0
-1

Hello,

unfortunately "autocomplete="off" is not supported by all web browser.

It looks more secured to randomize the input name attribute. This would prevents auto-completion for all browsers.

- You could have a look at this jquery plugin:

https://github.com/terrylinooo/jquery.disableAutoFill

or

- you can try to reproduce the same behavior using a UID javascript expression.

Hope that helps,

Julien.

Notifications