0

i have an input field of this style:

<div class="contactotexto">{{ form_label(form.username, 'Nombre de Usuario: ') }}</div>
<div class="contactocampo">{{ form_widget(form.username) }}</div>
<div class="mensaje"><p>Ingrese un nombre de usuario entre 5 y 20 caracteres.</p></div>

"p" tag remains hidden until a focus on the input is done, and then I show it with jquery.

My problem is that when the text is focus , the text appears but as the user's browser remembers the latest posts , it cover them.

The suggestions cover the text!

In what way I can remove suggestions ?

Thanks

Geronimo
  • 421
  • 4
  • 17
  • Take a look at https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion - as Besbes Riadh shows in his answer below, this is just a matter of ensuring you use the appropriate autocomplete HTML attribute – Paul Dixon Dec 29 '15 at 16:01

2 Answers2

5

You can do it in your FormBuilder with:

 ->add('test', 'text', array(
                'required' => true,
                'attr' => array(
                    'autocomplete' => 'off',
                ))
Besbes Riadh
  • 671
  • 1
  • 9
  • 22
0

This is a browser feature called "autocomplete" and disabling it will help solve your problem but it is not an easy thing to do and most browsers refuse to have it disabled for "security" concerns of users forgetting their passwords especially on sites that force you to use at least one capital, one number, one special one this and that.

Find out more from this related question here How do you disable browser Autocomplete on web form field / input tag?

Community
  • 1
  • 1
Don Omondi
  • 867
  • 11
  • 14