Skip to content

Instantly share code, notes, and snippets.

@radheymkumar
Created June 14, 2018 10:32
Show Gist options
  • Save radheymkumar/67b4e8c61da6dfdfa6056b433649bcdd to your computer and use it in GitHub Desktop.
Save radheymkumar/67b4e8c61da6dfdfa6056b433649bcdd to your computer and use it in GitHub Desktop.
function education_start_end_validates(array &$form, FormStateInterface $form_state) {
foreach ($form_state->getValue('edu_education_field') as $key => $value) {
if($value['start_date'] > $value['end_expected_end_date']) {
$form_state->setErrorByName("end_expected_end_date", t('Education : End/Expected End Date should be the greater than Start Date.'));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment