Geronimo
Geronimo

Reputation: 491

Disable suggestions of inputs - Symfony2

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

Upvotes: 0

Views: 1069

Answers (2)

Don Omondi
Don Omondi

Reputation: 946

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?

Upvotes: 0

Besbes Riadh
Besbes Riadh

Reputation: 861

You can do it in your FormBuilder with:

 ->add('test', 'text', array(
                'required' => true,
                'attr' => array(
                    'autocomplete' => 'off',
                ))

Upvotes: 5

Related Questions