<table class="table table-bordered table-striped">
<tr>
<th></th>
<th>Excellent</th>
<th>Satisfactory</th>
<th>Unsatisfactory</th>
<th>Poor</th>
</tr>
<tr>
<?php
$empty = false;
$x = 1 ;
while($x<=4)
{
if($Comments['Preparation']==$x)
{
$empty = true;
}
$x++;
}
?>
<td><b>Preparation</b>- Applicant has prepared his/her himself for the interview and the necessary documents.</td>
<td><input type="radio" name="Preparation" value="4" <?php if($Comments['Preparation']=='4') {echo "checked='checked'";} else if($empty) {echo "disabled='disabled'";}?>></td>
<td><input type="radio" name="Preparation" value="3" <?php if($Comments['Preparation']=='3') {echo "checked='checked'";} else if($empty) {echo "disabled='disabled'";}?>></td>
<td><input type="radio" name="Preparation" value="2" <?php if($Comments['Preparation']=='2') {echo "checked='checked'";} else if($empty) {echo "disabled='disabled'";}?>></td>
<td><input type="radio" name="Preparation" value="1" <?php if($Comments['Preparation']=='1') {echo "checked='checked'";} else if($empty) {echo "disabled='disabled'";}?>></td>
</tr>
<tr>
</tr>
</table>
我試圖預先選擇表格內的單選按鈕,因爲我想顯示它。 if
聲明表示我是否回顯「已檢查」。我一直在桌子外面使用它,它工作正常。 是否可以在表中使用單選按鈕?單選按鈕檢查不在表格內工作
有什麼問題?
'不工作'是一個很好的描述。實際發生了什麼?這與預期結果有什麼不同 – Steve 2014-10-02 14:20:07
我的預期結果是當我回顯檢查單選按鈕將被檢查。發生了什麼是另一個單選按鈕被禁用,但沒有選擇應該選擇的單選按鈕 – Maxxxxxxxx 2014-10-02 14:22:22
'checked =「checked」' – chaos505 2014-10-02 14:22:32