How do I iterate through dynamically generated checkboxes?
Posted: Tue Aug 30, 2011 4:01 am
pls Im having some problems with what method to use for a PHP manipulation.
PROBLEM: I want to make a teacher register student subjects on a web page by selecting the checkbox for each subject b4 submitting (so only checked subjects are registered). I put a single checkbox in a repeat region (which means at runtime, you will have as many checkboxes as there are subjects in the subject table).
How do I iterate through each checkbox (when submitted), register the checked subjects and ignore the unchecked ones. (to simplify it, just echo the values of checked subjects to the screen).
PROBLEM: I want to make a teacher register student subjects on a web page by selecting the checkbox for each subject b4 submitting (so only checked subjects are registered). I put a single checkbox in a repeat region (which means at runtime, you will have as many checkboxes as there are subjects in the subject table).
How do I iterate through each checkbox (when submitted), register the checked subjects and ignore the unchecked ones. (to simplify it, just echo the values of checked subjects to the screen).