我无法自定义生成的 php 之一,我想在其中显示隐藏的文本字段,用户可以在选中复选框后输入数据。
[ ] Data A
[x] Data B [Text Field Area for User to keyin]
[ ] Data C
复选框数据是从如下表中获取的
<tr>
<td class="ewTableHeader">
<span>Damaged Item</span>
</td>
<td class="ewTableAltRow">
<span id="cb_x_DamagedItem">
<?php
$sSqlWrk = "SELECT `DamegeItemID`, `DamageItemDesc` FROM `acc_damageitem`";
$rswrk = phpmkr_query($sSqlWrk,$conn) or die("Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL:' . $sSqlWrk);
$x_DamagedItemChk = "";
$rowcntwrk = 0;
$rowswrk = phpmkr_num_rows($rswrk)-1;
while ($datawrk = phpmkr_fetch_array($rswrk))
{
$x_DamagedItemChk .= RenderControl($rowswrk, $rowcntwrk, 1, 1);
$ar_x_DamagedItem = explode(",", @$x_DamagedItem);
$x_DamagedItemChk .= "<input type=\"checkbox\" name=\"x_DamagedItem[]\" value=\"" . htmlspecialchars(@$datawrk[0]) . "\"";
foreach ($ar_x_DamagedItem as $cnt_x_DamagedItem)
{
if ($datawrk[0] == trim($cnt_x_DamagedItem))
{
$x_DamagedItemChk .= " checked";
break;
}
}
$x_DamagedItemChk .= ">" . $datawrk[1] . RenderControl($rowswrk, $rowcntwrk, 1, 2);
$rowcntwrk++;
}
echo $x_DamagedItemChk;
?>
</span>
</td>
</tr>
非常感谢任何建议。提前致谢。