I don't expect anyone to do this for me but if you could at least point me in the right direction that will be a big help.
Please select between 1 and 3 hobbies from the list below:<br/>
<input type="checkbox" name="hobbies[]" id="cbx1" value="stamp" /><label for="cbx1">Stamp Collecting</label> <br/>
<input type="checkbox" name="hobbies[]" id="cbx2" value="movies" /><label for="cbx2">Movies</label> <br/>
<input type="checkbox" name="hobbies[]" id="cbx3" value="golf" /><label for="cbx3">Golf</label> <br/>
<input type="checkbox" name="hobbies[]" id="cbx4" value="bush" /><label for="cbx4">Bush Walking</label> <br/>
<input type="checkbox" name="hobbies[]" id="cbx5" value="read" /><label for="cbx5">Reading</label> <br/>
<input type="checkbox" name="hobbies[]" id="cbx6" value="music" /><label for="cbx6">Music</label> <br/>
<input type="checkbox" name="hobbies[]" id="cbx7" value="other" /><label for="cbx7">Other</label> <input type="text" name="other" /><br/>
<?php
echo 'no clue to what im doing';
?>
the checkboxes must only have 1-3 of them checked.
so i figured something like
$x = amount of check boxes checked
if ( $x > 3 ) {
echo 'to many';
} else if ($x < 1) {
echo 'not enough';
}
but the problem is im stuck =\
ALSO another problem:
When i submit the page for it to be validated, all the text boxes are emptied and the above check boxes are unchecked (the page refreshes itself or something), is there a way to keep the information on the page without losing it after pressing submit?