<?php if ($is_category) { ?>
<tr>
<th scope="row"><label for="ca_name">분류<strong class="sound_only">필수</strong></label></th>
<td colspan="4">
<table width='100%' cellpadding='0' cellspacing='0' style='margin:0 0 0 0'>
<?
$cate_menu = explode("|",$board[bo_category_list]);
$ca_td_num = "8"; //가로칸수. 원하는 칸수만큼 지정해주면 됩니다.
//$ca_td_width = 100 / $ca_td_num ;
for ($c=0, $cnt=count($cate_menu); $c<$cnt; $c++) {
if ($write[ca_name] == $cate_menu[$c]) { $checked[$c] = "checked"; } else { $checked[$c] = ""; }
if ($c == "0" || ($c >= $ca_td_num && $c % $ca_td_num == "0")) { echo "<tr>"; }
echo "<td width='".$ca_td_width."%' style='border:0px #fff solid;height:12px;font-weight:bold'>";
echo "<input type='radio' name='ca_name' value='$cate_menu[$c]' ".$checked[$c]." style='padding:0 4px 0 0'>";
echo $cate_menu[$c];
}
?>
</table>
</td>
</tr>
<?php } ?>
위와같이 글쓰기 게시판 셀렉트 분류를 라디오로 바꿨는데요.. 특정분류명 예를들면 분류명이 "된장" "고추장" "쌈장" 이렇게 있다면 글쓰기시 자동으로 "고추장"부분에 체크되어 있게 할려면 어케 해야되는지요.
답변 1개 / 댓글 1개
if (!$write[ca_name] ) $write[ca_name] ="고추장";
for ($c=0, $cnt=count($cate_menu); $c<$cnt; $c++) {
if ($write[ca_name] == $cate_menu[$c]) { $checked[$c] = "checked"; } else { $checked[$c] = ""; }
if ($c == "0" || ($c >= $ca_td_num && $c % $ca_td_num == "0")) { echo "<tr>"; }
echo "<td width='".$ca_td_width."%' style='border:0px #fff solid;height:12px;font-weight:bold'>";
echo "<input type='radio' name='ca_name' value='$cate_menu[$c]' ".$checked[$c]." style='padding:0 4px 0 0'>";
echo $cate_menu[$c];
}
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.