【问题标题】:how to display value of the checked checkboxes?如何显示选中复选框的值?
【发布时间】:2013-10-03 16:06:53
【问题描述】:
$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'];

   }

【问题讨论】:

  • 在哪里以及如何显示它们?用什么语言? edit 的值肯定是 $row['services'] 吗?

标签: php checkbox


【解决方案1】:

如果你有数据,你应该使用“checked”属性。更多请看这个 http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_checked

<input type="checkbox" name="vehicle" value="Car" checked> I have a car

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-04-13
    • 1970-01-01
    • 1970-01-01
    • 2022-06-23
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 1970-01-01
    相关资源
    最近更新 更多