1
<input type="checkbox" value="Administrative"  name="industry_sector1" <?php echo ($industry_sector1a == 'Administrative' ? "checked='checked'" : ''); ?>> Administrative
     </td>
                                    <td>
<input type="checkbox" value="Customer Service" name="industry_sector2" <?php echo ($industry_sector2a == 'Customer Service' ? 'checked="checked"' : ''); ?>> Customer Service

我该如何回显选定的复选框?尝试了上述方法。有任何想法吗

4

2 回答 2

1
<input type="checkbox" value="Administrative"   name="industry_sector1" <?php if(isset($_POST['industry_sector1'])) echo 'checked="checked"'; ?>> Administrative
<input type="checkbox" value="Customer Service" name="industry_sector2" <?php if(isset($_POST['industry_sector2'])) echo 'checked="checked"'; ?>> Customer Service
于 2011-02-26T23:06:02.010 回答
0
if (isset($_POST['industry_sector1']))
  echo "First checkbox checked";
if (isset($_POST['industry_sector2']))
  echo "Second checkbox checked";

或者你到底想做什么?

于 2011-02-26T23:03:54.773 回答