how to remove password confirmation field in user registration form? I want to remove password confirmation field. Its ok if user enters the password only once. There is no need to confirm it again.

I am using this code

&lt;?php
function dp_form_alter(&amp;$form, &amp;$form_state, $form_id)  {
    switch ($form_id)  {
        case 'user-register-form': 
        $form['account']['pass']['#type'] = "password"; 
            break;
     }
  }


Please tell me where am I wrong. Its not working. :(
The following code works for me in Drupal 7.

/**
 * Implements hook_form_FORM_ID_alter().
 */
function MODULE_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    $form['account']['pass']['#type'] = 'password';
    $form['account']['pass']['#title'] = 'Password';
}


Please note that the user registration form and the user profile form both have password confirmation fields and are not the same form.  You will need to alter both forms if you wish to remove all password confirmation fields.