여분필드출력

여분필드출력

QA

여분필드출력

본문

write.skin.php

<input type="radio" name="wr_2" class="ab" id="wr_2_1" value="star1"<?php echo ($write['wr_2'] == "star1") ? " checked" : "";?> required><label for="wr_2_1" class="star_label">star1</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_2" value="star2"<?php echo ($write['wr_2'] == "star2") ? " checked" : "";?> required><label for="wr_2_2" class="star_label">star2</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_3" value="star3"<?php echo ($write['wr_2'] == "star3") ? " checked" : "";?> required><label for="wr_2_3" class="star_label">star3</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_4" value="star4"<?php echo ($write['wr_2'] == "star4") ? " checked" : "";?> required><label for="wr_2_4" class="star_label">star4</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_5" value="star5"<?php echo ($write['wr_2'] == "star5") ? " checked" : "";?> required><label for="wr_2_5" class="star_label">star5</label>
<script>
    $(document).ready(function(){
        $('#star_box input.ab+label').click(function(){
          $(this).parent().children('#star_box input.ab+label').removeClass('on');
          $(this).addClass('on').prevAll('#star_box input.ab+label').addClass('on');
        });
    });
</script>

 

view.skin.php

<input type="radio" name="wr_2" class="ab" id="wr_2_1" value="star1"<?php echo ($view['wr_2'] == "star1") ? " checked" : "";?> disabled><label for="wr_2_1" class="star_label">star1</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_2" value="star2"<?php echo ($view['wr_2'] == "star2") ? " checked" : "";?> disabled><label for="wr_2_2" class="star_label">star2</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_3" value="star3"<?php echo ($view['wr_2'] == "star3") ? " checked" : "";?> disabled><label for="wr_2_3" class="star_label">star3</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_4" value="star4"<?php echo ($view['wr_2'] == "star4") ? " checked" : "";?> disabled><label for="wr_2_4" class="star_label">star4</label>
<input type="radio" name="wr_2" class="ab" id="wr_2_5" value="star5"<?php echo ($view['wr_2'] == "star5") ? " checked" : "";?> disabled><label for="wr_2_5" class="star_label">star5</label>

 

list.skin.php

<input type="radio" name="wr_2" class="ab" id="wr_2_1" value="star1"<?php echo ($list[$i]['wr_2'] == "star1") ? " checked" : "";?> required><label for="wr_2_1"></label>
<input type="radio" name="wr_2" class="ab" id="wr_2_2" value="star2"<?php echo ($list[$i]['wr_2'] == "star2") ? " checked" : "";?> required><label for="wr_2_2"></label>
<input type="radio" name="wr_2" class="ab" id="wr_2_3" value="star3"<?php echo ($list[$i]['wr_2'] == "star3") ? " checked" : "";?> required><label for="wr_2_3"></label>
<input type="radio" name="wr_2" class="ab" id="wr_2_4" value="star4"<?php echo ($list[$i]['wr_2'] == "star4") ? " checked" : "";?> required><label for="wr_2_4"></label>
<input type="radio" name="wr_2" class="ab" id="wr_2_5" value="star5"<?php echo ($list[$i]['wr_2'] == "star5") ? " checked" : "";?> required><label for="wr_2_5"></label>

 

mobile.css
#star_box input.ab {display:none;position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
#star_box input.ab+.star_label {display:inline-block;width:47px;height:47px;margin:.8em .8em 0 0;background:url(../img/mobile/star_off.png) no-repeat;background-size: 100% auto;text-indent:-9999em;}
#star_box input.ab+.star_label:last-child {margin-right:0;}
#star_box input.ab+.star_label.on {background:url(../img/mobile/star_on.png) no-repeat;background-size:100% auto;}

 

DB에는 wr_2 가 들어가있어요.

write.skin에선 별에 체크까지 되고 저장을 누르면
view.skin 이고 list.skin에선 별(star_off.png)은 뜨는데 write에서 별에 체크된것이 안뜹니다

이 질문에 댓글 쓰기 :

답변 2

write에 value값에 wr_2로 되어있네요 wr_2-1 이렇게 해야되지 않나요

write.skin.php 파일안에 input 박스를 감싸는 부모에 id값인 #star_box를 주셨나요?

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

회원로그인

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