I am trying to write a custom module in Drupal 8 to populate a taxonomy field (release_decade) based on information in another field (release_date) for a custom content type in order to create an exposed dropdown filter in a view.
I am using
hook_form_FORM_ID_alter & have tried attaching JS as suggested in autofilling-fields-based-on-another-field but the script does not seem to run & most of the other examples seem to cover Drupal 7.
Does anyone have any Drupal 8 specific suggestions for either: a) Autofilling a taxonomy field based on other content fields? b) Automatically assigning a taxonomy item to a hidden property when an entity is created?
Or am I going about this completely the wrong way?