<!--분류기능-->
<tr>
<th scope="row"><label for="wr_1">분류<strong class="sound_only">필수</strong></label></th>
<td>
<?
$cat1 = explode('|',$board['bo_1']);
$cat2 = explode('|',$board['bo_2']);
?>
<input type="hidden" id="cat2" value= "<?=$board[bo_2]?>">
<select name="wr_1" id="wr_1" required onchange="select_wr1();">
<?if(!$write[wr_1]){?>
<option value="1차분류">1차분류 선택하세요.</option>
<?for($i = 0; $i < count($cat1); $i++){?>
<option id = "<?=$i?>"value="<?=$cat1[$i]?>"><?=$cat1[$i]?></option>
<?}?>
<?}else{?>
<option value="<?=$write['wr_1']?>"><?=$write['wr_1']?></option>
<?for($i = 0; $i < count($cat1); $i++){?>
<?if($cat1[$i] == $write[wr_1]){?>
<?}else{?>
<option id = "<?=$i?>"value="<?=$cat1[$i]?>"><?=$cat1[$i]?></option>
<?}?>
<?}?>
<?}?>
</select>
<span id="selectname">
<?if($write['wr_2']){?>
<select name="wr_2" id="wr_2" required>
<option value="<?=$write[wr_2]?>"><?=$write[wr_2]?></option>
</select>
<?}?>
</span>
<script>
function select_wr1() {
var msg = $("#selectname");
var rs = $("#wr_1").val();
var rn = $("#wr_1 option").index($("#wr_1 option:selected"));
var ra = $("#cat2").val();
$.ajax({
async: false,
cache: false,
type: "POST",
url: "../skin/board/cat_gallery/ajax_cat.php",
data: "val=" + rs + "&index=" + rn + "&cat2=" + ra,
dataType: "text",
success: function(response, textStatus, xhr) {
msg.html(response);
msg.show();
},
error : function(xhr, textStatus) {
}
});
}
</script>
</td>
</tr>
<!--분류기능-->