게시판 폼관련 질문 드립니다.

게시판 폼관련 질문 드립니다.

QA

게시판 폼관련 질문 드립니다.

본문

아래처럼 했는데요 안되요

왜 안되는지 모르겠습니다.

일반후원 결연후원 물품후원 기타  이중에서 하나만 선택하게 되면

뷰페이지에도 똑같이 코딩이 되어 있어서 거기에 체크가 되어야 하는데

아무런 체크가 안나와요

좀 도와주세요

write.skin.php  파일에


 
$wr16 = explode('|',$write['wr_16']);
$wr_16_1  = $wr16[0];
$wr_16_2  = $wr16[1];
$wr_16_3  = $wr16[2];
$wr_16_4  = $wr16[3];
 
<div class="req_box">
            <div class="col-xs-12">
                <div class="req_capt col-md-3"><font color="#0c4ca3">*</font> 후원종류</div>
                <div class="req_inp req_inppd col-md-9">
                    <div>
                        <input type="radio" name="wr_16" id="wr_16_1" value="1" <?php echo ($write['wr_16_1'] == "1") ? " checked" : "";?>  required /><label for="wr_16_1">일반후원</label>    
                        <input type="radio" name="wr_16" id="wr_16_2" value="2" <?php echo ($write['wr_16_2'] == "2") ? " checked" : "";?> required /><label for="wr_16_2">결연후원</label>    
                        <input type="radio" name="wr_16" id="wr_16_3" value="3" <?php echo ($write['wr_16_3'] == "3") ? " checked" : "";?> required /><label for="wr_16_3">물품후원</label>    
                        <input type="radio" name="wr_16" id="wr_16_4" value="4" <?php echo ($write['wr_16_4'] == "4") ? " checked" : "";?> required /><label for="wr_16_4">기타</label>
                    </div>
                </div>
            </div>
        </div>

view.skin.php 파일에


// 후원종류
$wr16 = explode('|',$view['wr_16']);
$wr_16_1  = '('.$wr16[0].')';
$wr_16_2  = $wr16[1];
$wr_16_3 = $wr16[2];
$wr_16_4 = $wr16[3];
 
<div class="req_box">
        <div class="col-xs-12">
            <div class="req_capt col-md-3"><font color="#f47320">*</font> 후원종류</div>
            <div class="req_inp req_inppd col-md-9">
                <div>
                    <input type="radio" disabled name="wr_16" id="wr_16_1" value="1" <?php echo ($view['wr_16_1'] == "1") ? " checked" : "";?> required /><label for="wr_16_1">일반후원</label>    
                    <input type="radio" disabled name="wr_16" id="wr_16_2" value="2" <?php echo ($view['wr_16_2'] == "2") ? " checked" : "";?> required /><label for="wr_16_2">결연후원</label>    
                    <input type="radio" disabled name="wr_16" id="wr_16_3" value="3" <?php echo ($view['wr_16_3'] == "3") ? " checked" : "";?> required /><label for="wr_16_3">물품후원</label>    
                    <input type="radio" disabled name="wr_16" id="wr_16_4" value="4" <?php echo ($view['wr_16_4'] == "4") ? " checked" : "";?> required /><label for="wr_16_4">기타</label>
                </div>
            </div>
        </div>
    </div>

이 질문에 댓글 쓰기 :

답변 2

view.skin.php 에서,

 

$view['wr_16_2'] 를

-> $wr_16_2 나 $wr16[1] 로 수정해야 될 것 같습니다.

 


<div>
  <input type="radio" disabled name="wr_16" id="wr_16_1" value="1" <?php echo ($wr_16[0] == "1") ? " checked" : "";?> required /><label for="wr_16_1">일반후원</label>    
  <input type="radio" disabled name="wr_16" id="wr_16_2" value="2" <?php echo ($wr_16[1] == "2") ? " checked" : "";?> required /><label for="wr_16_2">결연후원</label>    
  <input type="radio" disabled name="wr_16" id="wr_16_3" value="3" <?php echo ($wr_16[2] == "3") ? " checked" : "";?> required /><label for="wr_16_3">물품후원</label>    
  <input type="radio" disabled name="wr_16" id="wr_16_4" value="4" <?php echo ($wr_16[3] == "4") ? " checked" : "";?> required /><label for="wr_16_4">기타</label>
</div>

 


// 후원종류
$wr16 = explode('|',$view['wr_16']);
$wr_16_1  = '('.$wr16[0].')';
$wr_16_2  = $wr16[1];
$wr_16_3 = $wr16[2];
$wr_16_4 = $wr16[3];
// 위에 분해한 값을 참조하게 아래 코드들 수정하세요 쓰기/보기 모두
 
<div class="req_box">
        <div class="col-xs-12">
            <div class="req_capt col-md-3"><font color="#f47320">*</font> 후원종류</div>
            <div class="req_inp req_inppd col-md-9">
                <div>
                    <input type="radio" disabled name="wr_16" id="wr_16_1" value="1" <?php echo ($wr_16_1 == "1") ? " checked" : ""; //wr_16 분해한값을 참조해야됨 ?> required /><label for="wr_16_1">일반후원</label>    
                    <input type="radio" disabled name="wr_16" id="wr_16_2" value="2" <?php echo ($view['wr_16_2'] == "2") ? " checked" : "";?> required /><label for="wr_16_2">결연후원</label>    
                    <input type="radio" disabled name="wr_16" id="wr_16_3" value="3" <?php echo ($view['wr_16_3'] == "3") ? " checked" : "";?> required /><label for="wr_16_3">물품후원</label>    
                    <input type="radio" disabled name="wr_16" id="wr_16_4" value="4" <?php echo ($view['wr_16_4'] == "4") ? " checked" : "";?> required /><label for="wr_16_4">기타</label>
                </div>
            </div>
        </div>
    </div>

답변을 작성하시기 전에 로그인 해주세요.
전체 95
QA 내용 검색
filter #폼 ×

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT