How to change (or set) the attribute "autocomplete" of a form?

How to change (or set) the attribute "autocomplete" of a form?

by Lawrence Lagerlof -
Number of replies: 0

I am instantiating a form definition like this:

$form1 = new form1($PAGE->url);

It's working, however I want to turn the "autocomplete" attribute to "off". I tried to set the attribute following the moodleform class signature:

$form1 = new form1($PAGE->url, null, 'post', '', ['autocomplete' => 'off']);

But the "autocomplete" continue "on". To test if I can change other attributes I tried to set a fake one, like this:

$form1 = new form1($PAGE->url, null, 'post', '', ['fake' => 'off']);

And the attribute fake was set to "off".

So, what is the way to change/set the attribute autocomplete after instantiate the form?

Thank you.


Average of ratings: -