I want to stop the browser auto-filling form entries. I understand there is a PHP attribute {autocomplete="off"} which can be put in the form header. Can anyone tell me in which file that would be put?
Background: On our form people have to give a justification for using the service. The first time they enter it but on subsequent times their browser auto-fills the last entry so we don't get a proper response.
We are a bit out date - sorry! v1.12.1, Apache2 4.29, SQL 5.728, PHP 7.2.27
How to disable autofill on form
Thank you - that's just what I want. But can you tell me in which source file this <form> is defined?
It's my understanding that forms are generated from Admin panel -> manage -> forms. The data for the forms are stored in the database. You will have to dig through the source to locate it.
- Edited
Sorry for the zombie bump, but wanted to post the solution for any other future searchers coming here to turn off autocomplete/autofill on a New Ticket form.
Within "include/class.forms.php", in the class "TextboxWidget" block (line 4382), change
<input type="<?php echo $type; ?>"
to <input autocomplete="none" type="<?php echo $type; ?>"
and in the class "TextareaWidget" block (line 4471) change
<textarea <?php echo Format::array_implode('=', ' ',
to <textarea autocomplete="none" <?php echo Format::array_implode('=', ' ',
I used "none" instead of "off" because I read there are some issues with chrome and the autocomplete "off" flag that I didn't verify. I only needed it turned off with Short Answer and Long Answer fields, but you should be able to make the same changes to the other classes if you need.
This was done in the current version v1.17.2 but this is the only thread I found through Google where someone asked this question.