How to change the order of fields in field account in the user profile form? 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") {
   dpm($form) 
}


But then? I do not see any key or weight in this array..
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.