How can I update the values of an exposed view filter when another filter changes value?
This module might help: Views Dependent Filters

If you really want a custom solution take a peek at the code there and see if it helps, or help the D8 version get released :)