【发布时间】:2014-12-18 09:53:11
【问题描述】:
我正在做一个员工评估系统,我现在在评估表管理。
为了显示评分标准,我使用了 do while 循环 [单选按钮包含在循环中]。 这是我的代码:
<fieldset>
<table border="1">
<tr><br />
<th width="700px">AREAS TO RATE</th>
<th width="100px">1</th>
<th width="100px">2</th>
<th width="100px">3</th>
<th width="100px">4</th>
</tr>
<?php
$rates="select * from tbl_torateareas;";
$raters=mysqli_query($con,$rates);
$raterows=mysqli_fetch_array($raters);?>
<?php do{?>
<tr>
<td><?php echo $raterows['torateareas'];?></td>
<th><input type="radio" name="rad" /></th>
<th><input type="radio" name="rad" /></th>
<th><input type="radio" name="rad" /></th>
<th><input type="radio" name="rad" /></th>
</tr>
<?php }while($raterows=mysqli_fetch_array($raters)); ?>
</table>
</fieldset>
为了选择一个单选按钮,我将所有单选按钮命名为相同的名称 [名称为: rad]。当我这样做时,整个表格只选择了一个单选按钮。例如,对于我的表中的 10 行 - 仅选择了 1 个单选按钮,这应该是 每行一个单选按钮。嗯嗯嗯。
请帮忙。谢谢!
【问题讨论】:
-
更改每一行的电台名称 :)
-
先生,我将如何改变它?我在这里使用了循环。
标签: php html mysql radio-button