라디오버튼 선택 안해도 기본값 나오게 하고 싶습니다.
본문
안녕하세요.
이것저것 소스 기웃기웃하면서 작업 중인데, 막히는 부분 있어서 문의드립니다.
라디오 버튼을 클릭하면 팀원1~3이 보였다가 안보였다가 하는 부분은 했는데,
기본적으로 팀원 1~3이 안보이게 하고 싶습니다.
사이트 주소는 http://www.edc2022.or.kr/bbs/write.php?bo_table=request 이고, 관련 소스는 다음과 같습니다.
잘 부탁드립니다.
[code]
<script>
function wr_view(val){
//val = typeof val == 'undefined' ? val : 1;
if(val === undefined) {
var val = 1;
}
if(val=='1'){
tr1.style.display = 'none';
tr2.style.display = 'none';
tr3.style.display = 'none';
} else {
tr1.style.display = '';
tr2.style.display = '';
tr3.style.display = '';
}
//console.log(val);
}
</script>
<section id="bo_w">
<div class="inner">
<div class="board_content_head list_tit">
<h3 class="board_content_tit"><? if($w == "u"){ echo "공모전 수정하기"; } else { echo "공모전 접수하기"; } ?></h3>
</div>
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?php echo $width; ?>">
<div class="product_notice wow fadeInUp">
<div class="tb-wrap">
<fieldset class="fregister_agree">* 표시는 필수 입력 사항입니다.</fieldset>
<table>
<colgroup>
<col width="30%">
<col width="">
</colgroup>
<tbody>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">참가구분 <span>*</span></td>
<td style="text-align:left;padding-left:20px;"><input type="radio" name="wr_1" value="1" id="1" class="frm_input" onclick='wr_view(this.value);' <?php if($wr_1 == "1"){ echo " checked"; } ?>>개인 <input type="radio" name="wr_1" value="2" id="2" class="frm_input" onclick='wr_view(this.value);' <?php if($wr_1 == "2"){ echo " checked"; } ?>>팀</td>
</tr>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">이름 <span>*</span></td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_3" value="<?php echo $wr_3 ?>" class="frm_input" size="50" maxlength="60" placeholder="개인 또는 대표자" required></td>
</tr>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">닉네임/팀명 <span>*</span></td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_name" value="<?php echo $name ?>" class="frm_input" size="50" maxlength="60" placeholder="개인은 닉네임, 팀은 팀명을 넣어주세요" required></td>
</tr>
<tr id="tr1">
<td style="background:#daeafd;font-weight:500;text-align:center;">팀원1</td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_7" value="<?php echo $wr_7 ?>" class="frm_input" size="50" maxlength="60" placeholder="이름 / 소속 / E-mail / 휴대폰 번호"></td>
</tr>
<tr id="tr2">
<td style="background:#daeafd;font-weight:500;text-align:center;">팀원2</td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_8" value="<?php echo $wr_8 ?>" class="frm_input" size="50" maxlength="60" placeholder="이름 / 소속 / E-mail / 휴대폰 번호"></td>
</tr>
<tr id="tr3">
<td style="background:#daeafd;font-weight:500;text-align:center;">팀원3</td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_9" value="<?php echo $wr_9 ?>" class="frm_input" size="50" maxlength="60" placeholder="이름 / 소속 / E-mail / 휴대폰 번호"></td>
</tr>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">소속</td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_content" value="<?php echo $content ?>" class="frm_input" size="50" maxlength="60"></td>
</tr>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">이메일 <span>*</span></td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_email" value="<?php echo $email ?>" class="frm_input" size="50" maxlength="60" required></td>
</tr>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">휴대폰 번호 <span>*</span></td>
<td style="text-align:left;padding-left:20px;"><input type="text" name="wr_4" value="<?php echo $wr_4 ?>" size="4" class="frm_input" maxlength="3"> - <input type="text" name="wr_5" value="<?php echo $wr_5 ?>" size="4" class="frm_input" maxlength="4" required> - <input type="text" name="wr_6" value="<?php echo $wr_6 ?>" size="4" class="frm_input" maxlength="4" required></td>
</tr>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">비밀번호 <span>*</span></td>
<td style="text-align:left;padding-left:20px;"><input type="password" name="wr_2" size="50" maxlength="15" class="frm_input" placeholder="숫자와 영문을 혼합해 8~15자 내로 적어주십시오" required></td>
</tr>
<tr>
<td style="background:#daeafd;font-weight:500;text-align:center;">비밀번호 확인 <span>*</span></td>
<td style="text-align:left;padding-left:20px;"><input type="password" name="wr_10" size="50" maxlength="15" class="frm_input" placeholder="숫자와 영문을 혼합해 8~15자 내로 적어주십시오" required></td>
</tr>
</tbody>
</table>
</div>
[/code]