FOSUserBundle configure change_password error message

I use Symfony 2.1 for the project and FOSUserBundle for user management.

I am trying to set up a password form for a change and I cannot display error messages. In fact, when the input is mistakenly filled, an error message is printed between the label and the input (with the list structure). But I like to display it after typing or below.

In addition, I would like to display the password change form on the settings page, so I need to display some other forms. How can I integrate this form into the exact location on the page?

Thanks in advance, Valentin

+4
source share
1 answer

For my first question, I managed to change change_password with this form:

<form action="{{ path('fos_user_change_password') }}" {{ form_enctype(form) }} method="POST" class="fos_user_change_password"> <div class="form_errors_change_pwd"> {{ form_errors(form) }} </div> <div> {{ form_label(form.current_password) }} {{ form_widget(form.current_password) }} <span class="form_error_field">{{ form_errors(form.current_password) }}</span> </div> <div> {{ form_label(form.new.first) }} {{ form_widget(form.new.first) }} <span class="form_error_field">{{ form_errors(form.new.first) }}</span> </div> <div> {{ form_label(form.new.second) }} {{ form_widget(form.new.second) }} <span class="form_error_field">{{ form_errors(form.new.second) }}</span> </div> {{ form_rest(form) }} <div> <input type="submit" value="{{ 'change_password.submit'|trans({}, 'FOSUserBundle') }}" /> </div> 

But I'm still trying to integrate this form into another page with multiple forms ...

+1
source

Source: https://habr.com/ru/post/1437322/


All Articles