I'm building a WordPress-based attendance system for courses using MetaBox and TutorLMS. Here's what I currently have set up:
I have a CPT called attendance (using custom table) with the following custom fields:
* course_id (a post field selecting from the courses CPT)
* tutorial_date (a select field)
* students_present (a checkbox_list field showing enrolled students)
The courses CPT (created by TutorLMS) has a repeatable MetaBox Custom Field group tutorial_list with:
* tutorial_date
* tutorial_location
Student enrolments are stored by TutorLMS as custom posts of type tutor_enrolled, where:
* post_author is the user ID
* post_parent is the course ID
What I want:
When a user selects a course_id in the attendance form using metabox fronted submission:
1. The tutorial_date dropdown should be dynamically populated with dates and locations from that course’s tutorial_list field.
2. The students_present checkbox list should be dynamically populated with the enrolled students for the selected course.
I need help in understanding the best way to dynamically populate that on the front end form and ensure that it is then saved to the database