You are here

public function TrainingForm::submitFormAjax in Opigno statistics 8

Ajax form submit.

File

src/Form/TrainingForm.php, line 875

Class

TrainingForm
Implements the training statistics page.

Namespace

Drupal\opigno_statistics\Form

Code

public function submitFormAjax(array &$form, FormStateInterface $form_state) {
  $trigger = $form_state
    ->getTriggeringElement();
  if (isset($trigger['#name']) && $trigger['#name'] == 'year') {
    $form['trainings_progress']['month']['#value'] = 'none';
  }
  return $form['trainings_progress'];
}