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 gibbo1715 on
Hi
I've done quite a bit of reading about the following but still haven't found the best way to do the following
In my custom module I have a drop down containing a list, when a user selects an item from that list I want it to go and get a list of records from the database associated with the record selected in the first drop down, and then display a second drop down with the results.
What is the best way to do this please using forms, can anyone point me at an example please
Many Thanks
Comments
This is done using the #ajax
This is done using the #ajax of the Form API. There is an example in the Examples module.