currently i have produced a set of checkbox based from database
It looks like
Week 1 Week 2 Week 3 Week 4 .....
Student 1 [] [] [] []
Student 2 [] [] [] []
Student 3 [] [] [] []
Student 4 [] [] [] []
.....
[] represents checkbox
How do i get whatever ticked by user? I am using attendance_list[] as name for checkbox but however when one is ticked, it returns value for all users.
Thank you.
You should use a multi-dimensional array to represent students and their attendance.
For example,
Server side, you’ll get an array of elements that have been checked. Using the indexes of the array, you can determine which student was in attendance during which weeks.
If all of the above checkboxes were checked, your array would look like so:
This indicates that Student 1 and Student 2 were in attendance for all 4 weeks.