0

I need to change the password field label on the registration form. Name and Email I changed through hook_form_alter and password does not work. Help me!

$form['account']['name']['#title'] = 'Имя пользователя/Login';
$form['account']['mail']['#title'] = 'E-mail адрес/E-mail';

1 Answer 1

1

Here is the soluition (need to clear the caches):

function MYMODULE_element_info_alter(&$type)
{
    // dpm($type);
    // assuming it's a password_confirm type
    $type['password_confirm']['#process'][] = 'custom_pass';
}

function custom_pass($element)
{
    $element['pass1']['#title'] = 'Пароль / Password';
    ...

    return $element;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.