Created a content type and add taxonomy form in it using Inline entity Form module.
So, the rendered taxonomy add term looks like :
What I want to do is ADD CUSTOM VALIDATION to the "NAME" field.
I tried:
function hook_inline_entity_form_entity_form_alter(&$entity_form, &$form_state) {
//kint($form_state->getStorage('inline_entity_form'));die;
// $entity = $form_state->getFormObject()->getEntity();
// $nid = $entity->get('name')->getValue();
$userInput = $form_state->getUserInput();
// kint($form_state->getUserInput()['field_plan_features']['form']['inline_entity_form']['name']);die;
// $form_state->setErrorByName('name', t('Term already exists in taxonomy blah'));
}
How it can be done.. please suggest some way.