Depending on the number of ncars that the user has in his entries, flags ncan be selected.
In my opinion, these flags are displayed using a loop
<?php
foreach ($cars as $row):
echo form_checkbox('cars_id[]', $row->cars_id, FALSE, 'class="checkbox"') .
<span>'. $row->cars_name . '</span><br />';
endforeach;
?>
I want to show a message if the user selects> 1 checkbox --- like this:
[x] Honda
[ ] Toyota
[ ] Suzuki
[x] Honda
[X] Toyota
[ ] Suzuki
I tried to do this without success using options
if ($(".checkbox").is(':checked')) { etc...
Does anyone have any suggestions on how to make this work?
Thank you very much for your help.
source
share