Inline entity form ajax I am trying to update some field options in an inline entity form with ajax. This should happen, when someone selects a value in an other field.

I already have some code which "works", but the problem is that you can edit multiple items and there seems to be a problem with the wrapper_id, because it is for all items the same and the entityForm function is called multiple times.

So what is the best way to do this?
What about adding wrappers to the fields?

In your hook_form_alter:

$form['field_name']['#prefix'] = '&lt;div class="last"&gt;';
$form['field_name']['#suffix'] = '&lt;/div&gt;&lt;div class="clearfix"&gt;&lt;/div&gt;';


Check https://www.webomelette.com/drupal-form-api-prefix-suffix