Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ejustice on
I'm working on a module that enhances a content type containing an entity reference field (which uses autocomplete). I'd like to populate other parts of my form with some of the data from the node that is referenced when the user fills out the reference field. I'm able to add ajax callbacks to other fields on the form, so I'm wondering if there is a conflict between autocomplete (which uses ajax) and my additional ajax callback.
Comments
Your explanation was rather
Your explanation was rather general, so my rather general reply is that Drupal autocomplete and #ajax are able to work together. I've added additional autocomplete fields using #ajax in the past, and I've also created additional fields based on a value that was entered in an autocomplete.
I was looking for a general answer
Thanks for your response. I just was trying to determine if there was some conflict between using both the autocomplete and the ajax functions for an individual form field.
did you manage to get an ajax
did you manage to get an ajax call working with the entity ref field? This works for the fied_job_type which is a select term reference, but as soon as I update the code to point to my autocomplete entity reference field it doesn't work.
Here's how to do it
To find the actual answer see https://www.drupal.org/node/1775464.
http://blog.marceisaacson.com