Updating Class sections based on a selected course

I am creating a testing website. I am trying to create a form where teachers can create a test for one or more sections of a course that they are teaching. Inside the form, the teacher will see the courses that they are teaching and once that is selected I query for the sections in the selected course. The problem is I am not sure how to query for the sections without it throwing a INVALID HOOK CALL error. I have attached the query code the the test form.
Screenshot_2023-05-05_at_4.40.13_PM.png
Screenshot_2023-05-05_at_4.40.33_PM.png
Screenshot_2023-05-05_at_4.41.19_PM.png
Was this page helpful?