-2
$section = mysql_query("SELECT services.services, services.price FROM services WHERE pet_breed = 'Dog'");

    while ($row = mysql_fetch_array($section))
   {

    echo "<br><input type='checkbox' id=check data-price='".$row['price']."' class='service' name='pet[]' value ='".$row['services']."'";
    echo " />";
    echo $row['services'];

   }
4

1 回答 1

0

you should use "checked" property in case you have data. for more please see this http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_checked

<input type="checkbox" name="vehicle" value="Car" checked> I have a car
于 2013-10-03T08:06:53.507 回答