You are here

public static function PasswordConfirm::validate in YAML Form 8

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

File

src/Plugin/YamlFormElement/PasswordConfirm.php, line 53

Class

PasswordConfirm
Provides a 'password_confirm' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public static function validate(array &$element, FormStateInterface $form_state) {
  $name = $element['#name'];
  $value = $form_state
    ->getValue($name);
  $form_state
    ->setValue($name, $value['pass1']);
}