function expand_password_confirm in Drupal 6
Same name and namespace in other branches
- 4 includes/form.inc \expand_password_confirm()
- 5 includes/form.inc \expand_password_confirm()
Expand a password_confirm field into two text boxes.
Related topics
1 string reference to 'expand_password_confirm'
- system_elements in modules/
system/ system.module - Implementation of hook_elements().
File
- includes/
form.inc, line 1696
Code
function expand_password_confirm($element) {
$element['pass1'] = array(
'#type' => 'password',
'#title' => t('Password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],
'#required' => $element['#required'],
'#attributes' => array(
'class' => 'password-field',
),
);
$element['pass2'] = array(
'#type' => 'password',
'#title' => t('Confirm password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],
'#required' => $element['#required'],
'#attributes' => array(
'class' => 'password-confirm',
),
);
$element['#element_validate'] = array(
'password_confirm_validate',
);
$element['#tree'] = TRUE;
if (isset($element['#size'])) {
$element['pass1']['#size'] = $element['pass2']['#size'] = $element['#size'];
}
return $element;
}