Hey all, I'm struggling with an issue in a admin panel I am coding for a website.
The admin should be able to upload a photo to a category, optionally with a subcategory and detail category. I would like to display the categories in dropdowns. Each category group in it's own dropdown. The main category is no problem, I can get this done, however I'm not sure how I can do the following: I want the subcategory and detailcategory dropdowns to be filled with the subcategories and detailcategories that correspond to the categories above it.
Example: I have main category A with subategories B and C and detailcategory D.
I would like the second dropdown then to reload it's options and add subcategories B and C. If one of them is selected I would like detailcategory D to show up in the third dropdown. I know javascript can do the dependable dropdowns, but I'm not sure on how I should do it when I want to get the values from the database.
All categories and subcategories are linked to each in the database and I have the correct queries ready, all I need to know is, can I execute a specific query when a specific option has been selected from a previous dropdown ?
Hope you understand what I mean. If anything is unclear, please ask and I will try to explain it more clearly.
Thanks 🙂