I'm having a hard time validating a checkbox. How to do it?
This is my checkboxes input
<input type="checkbox" name="topic[]" value="HTML"/>HTML<br/>
<input type="checkbox" name="topic[]" value="XHTML"/>XHTML<br/>
<input type="checkbox" name="topic[]" value="CSS"/>CSS<br/>
<input type="checkbox" name="topic[]" value="JavaScript"/>JavaScript<br/>
<input type="checkbox" name="topic[]" value="XML"/>XML<br/>
<input type="checkbox" name="topic[]" value="PHP"/>PHP<br/>
I would like to check whether the user select at least one of the items using FOR LOOP. I don't need to display the check values. I just want to make the selection mandatory.