Hello,

When [x] Set Password is checked in the LoginToboggan settings, there are two input boxes for Password and Confirm Password on the Registration page. I would like to only have one input box for Password and no Confirm Password. Maintainer of LoginToboggan says the password input boxes are provided by core and not LT.

Many sites require only one entry of a password, ie Twitter and Facebook. If the user mis-types the password he/she can easily go to the Request New Password and be sent a one-time login link.

Would anyone please be able to assist in removing the Confirm Password input box?
Is there already a contrib module that allows this functionality?

Thank you very much!

Comments

Bilmar’s picture

Thanks to S13 and Raj for all the help!

This is the code that worked in my case bc I was using LoginToboggan module (must go into a custom module)

function mymodule_form_user_register_alter(&$form, &$form_state) {
  $form['account']['pass']['#type'] = 'password';
  $form['account']['pass']['#title'] = 'Password';
}

This would be the code that would most likely work for you.

function mymodule_form_user_register_alter(&$form, &$form_state) {
  $form['pass']['#type'] = 'password';
  $form['pass']['#title'] = 'Password';
}

Things I learned:
1) the code must go into a custom module
2) the code will not work in template.php as in example below.

function mytheme_preprocess_user_register(&$vars) {
  $vars['form']['account']['pass']['#type'] = 'password';
  $vars['form']['account']['pass']['#title'] = 'Password';
}

3) check out the $form array structure by typing the below at the top of the user-register.tpl.php file

<?php print_r($form); ?>

or for a cleaner layout enable devel module and use this code

<?php dprint_r($form); ?>

Regards

imDhaval’s picture

i want to remove Confirm password field from registration form


function mymodule_form_user_register_alter(&$form, &$form_state) {
  $form['pass']['#type'] = 'password';
  $form['pass']['#title'] = 'Password';
}

this is my module file, but it is not working for me