expand_password_confirm

Versions
5 – 6
expand_password_confirm($element)

Expand a password_confirm field into two text boxes.

Related topics

Code

includes/form.inc, line 1112

<?php
function expand_password_confirm($element) {
  $element['pass1'] =  array(
    '#type' => 'password',
    '#title' => t('Password'),
    '#value' => $element['#value']['pass1'],
    '#required' => $element['#required'],
  );
  $element['pass2'] =  array(
    '#type' => 'password',
    '#title' => t('Confirm password'),
    '#value' => $element['#value']['pass2'],
    '#required' => $element['#required'],
  );
  $element['#validate'] = array('password_confirm_validate' => array());
  $element['#tree'] = TRUE;

  if (isset($element['#size'])) {
    $element['pass1']['#size'] = $element['pass2']['#size'] = $element['#size'];
  }

  return $element;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.