You are here

public static function PasswordConfirm::validatePasswordConfirm in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/PasswordConfirm.php \Drupal\webform\Plugin\WebformElement\PasswordConfirm::validatePasswordConfirm()

Form API callback. Convert password confirm array to single value.

File

src/Plugin/WebformElement/PasswordConfirm.php, line 88

Class

PasswordConfirm
Provides a 'password_confirm' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public static function validatePasswordConfirm(array &$element, FormStateInterface $form_state, array &$completed_form) {
  $value = $element['#value'];
  $form_state
    ->setValueForElement($element, $value['pass1']);
}