How to handle Custom Validation in inline entity Form? I'm using Drupal8's inline entity form and is having issue with writing custom validation. I found few links and wasn't helpful at all. Does anyone know how to handle this?
You have to use inline form alter for custom validation in module shown below

/**
 * {@inheritdoc}
 *
 * Implements hook_form_alter().
 */
function module_inline_entity_form_entity_form_alter(&amp;$entity_form, &amp;$form_state) {

  // Added custom validation 
  if ($entity_form['#bundle'] == 'bundle_name') {
    $entity_form['#element_validate'][] = '_custom_validate_function';
  }
}


And implement that validation like below.

/**
 * Custom validation.
 */
function _custom_validate_function(&amp;$form, FormStateInterface $form_state) {

 $triggering_element = $form_state-&gt;getTriggeringElement();
 $values = $form_state-&gt;getValues();
 // or you can use $form_state-&gt;getValue('field_name')
 // Validate your functionality

 // Set Error for form
 $form_state-&gt;setError($form, t("message"));
 // Note: $name may be unknown in $form_state and
 // $form_state-&gt;setErrorByName($name, $message) may suppress the error message.
 // hence use above $form_state-&gt;setError()
}