In the user detail screen (user_profile_form) there is a field: account.

In this field there a different form fields. How to change the order of these form fields? I would like to group the fields current password, new password and confirmation password together.

I did by form_alter ...

if($form_id == "user_profile_form") {

But then? I do not see any key or weight in this array..

1 Answer 1


You're half-way there: just add something like

$form['account']['pass']['#weight'] = -6;

(event if you don't see the #weight key) and check the results - in this example you should see the current password field go right below password fields.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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