diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index a952490995b..1d14f369430 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -1,4 +1,3 @@ - <%= form_for @user do |f| %> <%= base_errors_for @user %> @@ -29,7 +28,7 @@ <%= text_f f, :login, :disabled => msg.present? , :label_help => msg %> <%= text_f f, :firstname %> <%= text_f f, :lastname %> - <%= text_f f, :mail %> + <%= text_f f, :mail, id: "mail", required: f.object.mail_enabled%> <% unless @user == User.current %> <%= checkbox_f f, :disabled %> <% end %> @@ -68,7 +67,7 @@ <%= field_set_tag _("General") do %> - <%= checkbox_f f, :mail_enabled %> + <%= checkbox_f f, :mail_enabled, onchange: 'toggleMailRequired(this)' %>