I have checkboxes on a form that should only allow up to four selections.
What would I need to add to this code to limit the selection to 4. Now it lets you select more than 4.
<td class="resultsColumnName" id="vciColumnTitle" valign="bottom" align="center"><strong>VCI</strong><br>Cushion</td>
<td class="resultsColumnName" id="checkboxColumnTitle" valign="bottom" align="center"><strong><h2>Choose up<br> to 4 Shoes to<br> Compare</h2></strong></td>
</tr>
<?
do { ?>
<tr>
<td class="shoeNameResults"><?=$myrow[product_name];?></td>
<td class="shoeTciResults" align="center" width="30"><?=$myrow[tci];?></td>
<td class="shoeVciResults" align="center" width="30"><?=$myrow[vci];?></td>
<td class="shoeCheckboxResults" align="center" valign="top" height="20"><input type=checkbox name=shoes[] value="<?=$myrow[product_image]?>"></td>
</tr>
<?
} while ($myrow = mysql_fetch_array($result)); ?>
</table>
<? } else {
echo "Sorry, no records were found";
} ?></td>
</tr>
<tr>
<td width="5%"> </td>