hi,

I am trying to write a user registration module. Here is some code in the registerme.module file:

function registerme_user($op, &$edit, &$account, $category = NULL) {
global $min_len, $max_len, $min_pass;
switch ($op) {
case 'register': // user is registering
$form = array();

// Add the original registration form elements to this customized form
$form = array_merge($form, user_edit_form(NULL, NULL, TRUE) ); //$uid=null, $edit=null, $register=true

$form['account']['pass'] = array(
'#type' => 'password_confirm',
'#description' => t('Provide a password for the new account in both fields. '),
'#required' => TRUE,
'#size' => 30,
);

$form['account']['name']['#description'] = "Enter a user name that starts with a letter. It must be between $min_len and $max_len characters in length. Only letters, numbers, and underscores are allowed.";
$form['account']['mail']['#description'] = "Enter a valid email address. The email is not made public. ";

unset($form['account']['pass']['#description']);
$form['account']['pass']['pass1']['#description'] = "Create a password for your account. The password must be between $min_pass and $max_len characters in length.";
$form['account']['pass']['pass2']['#description'] = 'Retype the password above';

return $form;
} //end of switch
} //end of hook_user

The problem is I want to set the description for "password" and "confirm password" fields separately. My code does not work. Any help is appreciated. Thanks

Gloria

Comments

mattyoung’s picture

You should probably consider using the 'logintoboggan' module or use hook_form_alter()

gloria-g’s picture

I am learning to develop modules. This is the first module I am developing. I write this module for practice purpose. I want to make it work.

brei9000’s picture

Did you ever figure this out? I'm trying to do the same thing.