I have a simple multi-tiered dropdown list that I am building as a guide for others to replicate dropdowns that are dependent on selection. So far the logic works well to show and hide the appropriate fields, however, if the top level dropdown is changed, the inputs existing from the first selection remain.
The structure of the dropdown looks like this:
- Ford
- Ford Mustang
- Ford Mustang Mach1
- Ford Mustang Shelby GT350
- Ford Ranger
- Ford Ranger XLS
- Ford Ranger XLT
- Tesla
- Tesla Cybertruck
- Tesla Car
- Tesla Car Model Y
- Tesla Car Model X
- Fiat 500X
The initial dropdown looks like this:

Then, more dropdowns appear as you select a category

If users perfectly select what they want, there are no issues, but we all know that might not always be the case. The problem appears when they leave this as is, then say change the top-level dropdown of "Make" to something else.

The visibility of the dropdowns works nicely and the subcategories for Ford disappear, but the underlying selections remain, and when submitted, the data shows both selections.

Is there a way to clear the selections when a main dropdown is changed? So in this case since I changed my mind off of Ford and chose instead Tesla, the Ford entries would be removed and only the Tesla input would remain? I don't want users to have to consciously go back in to entries and manually clear other selections if they change their mind.
I am happy to answer any questions to help amplify what I am asking if this doesn't make sense. Thank you!