You are here

drupal表单元素: Password with Confirmation(带确认的密码)

老葛的Drupal培训班 Think in Drupal

该元素创建两个HTML密码字段,并附加一个验证器来检查两个密码是否匹配。例如,在用户模块中,当用户修改他/她的密码时,用到了该元素:
$form['account']['pass'] = array(
    '#type' => 'password_confirm',
    '#description' => t('To change the current user password, enter the new
        password in both fields.'),
    '#size' => 25,
);
 

Drupal版本: