小编Ink*_*231的帖子

保持复选框以PHP格式检查

我知道如何在出现错误时保持表单提交复选框,但我现在有一个不同的问题.我正在使用同名的复选框,人们可以点击1或多个.我希望它只是保持复选框的用户签填写如果有喜欢的,如果他们检查q1中的Q1B一个问题,但不是Q1C我只想Q1 A和Q1B上的错误再装入时表现出检查.现在,在出错时,将检查所有相同名称的复选框.我已经尝试将名称更改为q1 [],但这不起作用.你能看一下,让我知道如何解决这个问题吗?

这是我的代码.

    <tr>
<td style="width: 124px" class="style15">Tape Recorder<?php    if(isset($problems['tape[]'])) {?><font color="red">*</font><?php } ?></td>
<td class="style9"> 
    <input name="tape[]" id="tape1" type="checkbox" value="used before," <?php   if(isset($_POST['tape[]'])) echo "checked"; ?> 
  </td>
<td class="style9"> 
    <input name="tape[]" id="tape2" type="checkbox" value="helpful in past,"        <?php   if(isset($_POST['tape[]'])) echo "checked"; ?> </td>
<td class="style9"> 
    <input name="tape[]" id="tape3" type="checkbox" value="requesting from DACC" <?php if(isset($_POST['tape[]'])) echo "checked"; ?> </td>
<td class="style9"> 
    <input name="tape[]"  id="tape4" type="checkbox" value="NA" <?php if(isset($_POST['tape[]'])) echo "checked"; ?></td>
 </tr>
  <tr>
        <td style="width: 124px">Note Taker <?php if(isset($problems['note'])) {?> …
Run Code Online (Sandbox Code Playgroud)

php forms checkbox checked

2
推荐指数
1
解决办法
8813
查看次数

标签 统计

checkbox ×1

checked ×1

forms ×1

php ×1