mercredi 15 août 2018

Checkbox using PHP and While loop in form

I am trying to replicate this search that I do with a Select input but with a CheckBox for each select option but it doesn't work. It actually works with the select

<select required id="brand" name="brand" class="sm-form-control">
<option disabled value="">-- Brand--</option>
<?php
while($row= mysql_fetch_array($consult_brands)) {
echo "<option value='".$row["value"]."'>".$row["brand"]."</option>"; }
?>
</select>

Can you help me with the right way to do it in a Checkbox. The idea is that for every Brand I have in my SQL it creates a checkbox with a value and a Brand name.

Thanks for the help.




Aucun commentaire:

Enregistrer un commentaire