Changing the html and order of system fields(pass/email/locale/etc) of user edit form I have changed a number of forms accessible by users to fit a certain style. To do this I used an #after_build function that adds prefixes and suffixes to fields, as well as a bit of javascript. This was straightforward enough(and I hope the appropriate way to do that, though I'm not sure).

However, coming upon the user edit form, it does not behave as other forms do. The default system fields such as password, locale, email, etc, cannot be reordered and I can't seem to add prefixes or suffixes to them to insert my HTML.

I have read some things about using a template for forms via hook_theme() function, however I could not get Drupal to use my template file for the user profile edit form, though it works just fine for other forms. This was a last resort, however, and I prefer other means if possible.

How do I correctly alter the layout and html of the user profile edit form? Thank you for your time.
The reason the template method was not working on my site was the result of a caching issue.

To use a template file for the user profile form you can put this(or find the existing implementations of the hooks) in your template.php:

function yourtheme_form_user_profile_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['#theme'] = 'user_profile_form';
}

function yourtheme_theme($existing, $type, $theme, $path){
  return array(
    'user_profile_form' =&gt; array(
      'render element' =&gt; 'form',
      'template' =&gt; 'templates/form--user_profile',
    ),
  );
}


Template file name, in this example, becomes form--user_profile.tpl.php