检查无线电输入是否有值
如果数组 $row['featured'];
= 1 if $row['featured']; 我需要将收音机显示为选中状态= 0
不显示,因为选中
这里是代码
<?php
while($row = mysql_fetch_array($result))
{
?>
<tr>
<td width="6%" align="center"><input type="radio" name="features" value="<?php echo $row['featured']; ?>" /></td>
<td width="35%"><?php echo $row['job_title']; ?></td>
<td width="24%"><?php echo $row['category_name'] ?></td>
<td width="15%"><?php echo $row['job_location']; ?></td>
<td width="10%"><?php echo $row['status'] ?></td>
<td width="10%"><a href="job_edit.php?id=<?php echo $row['job_id']; ?>">Edit</a></td>
</tr>
<?php
}
?>
I need to show radio as checked if the array $row['featured'];
= 1 if $row['featured']; = 0
don't show as checked
here is the code
<?php
while($row = mysql_fetch_array($result))
{
?>
<tr>
<td width="6%" align="center"><input type="radio" name="features" value="<?php echo $row['featured']; ?>" /></td>
<td width="35%"><?php echo $row['job_title']; ?></td>
<td width="24%"><?php echo $row['category_name'] ?></td>
<td width="15%"><?php echo $row['job_location']; ?></td>
<td width="10%"><?php echo $row['status'] ?></td>
<td width="10%"><a href="job_edit.php?id=<?php echo $row['job_id']; ?>">Edit</a></td>
</tr>
<?php
}
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
演示
DEMO