Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony: How to disable form fields autocomplete?

Tags:

symfony

I used this in twig :

{{ form_start(form, { 'attr': {'autocomplete': 'off'} })  }}

and this in the controller action :

'attr'=>array('autocomplete' => 'off'

But the autocomplete still not disabled!!!!

like image 374
Susan Avatar asked Dec 02 '22 13:12

Susan


2 Answers

UPDATE: If you are using symfony 4 the proper way is using off

'attr'=>['autocomplete' => 'off']
like image 146
SpicyTacos23 Avatar answered Dec 05 '22 03:12

SpicyTacos23


You can use :'attr' => ['autocomplete' => 'disabled']

like image 36
Arco Voltaico Avatar answered Dec 05 '22 03:12

Arco Voltaico