게시판 댓글을 radio button으로 입력하고 싶은데요.

게시판 댓글을 radio button으로 입력하고 싶은데요.

QA

게시판 댓글을 radio button으로 입력하고 싶은데요.

본문

 댓글 입력창으로  textarea 아닌 ,라디오 버튼 input type="radio"으로 하고 싶어서 

view_comment.skin 파일 내의 댓글 입력을 아래와 같이 변경을 하였는데

 

2번째 이후 부터는 댓글이 모두 적용이 되어 나오는데

첫번째 라디오 버튼을 체크한  댓글이 표시가 되질 않습니다. 

<input type="radio" id="wr_content" name="wr_content" value="1"<?php echo ($c_wr_content == "1") ? " checked" : "";?> required> 서울 

 

 


        <label for="wr_content"> <span class="sound_only">지역구</span></label>
            <input type="radio" id="wr_content" name="wr_content" value="1"<?php echo ($c_wr_content == "1") ? " checked" : "";?> required> 서울
            <input type="radio" id="wr_content" name="wr_content" value="2"<?php echo ($c_wr_content == "2") ? " checked" : "";?> required> 경기도
            <input type="radio" id="wr_content" name="wr_content" value="3"<?php echo ($c_wr_content == "3") ? " checked" : "";?> required> 인천
            <input type="radio" id="wr_content" name="wr_content" value="4"<?php echo ($c_wr_content == "4") ? " checked" : "";?> required> 세종시
            <input type="radio" id="wr_content" name="wr_content" value="5"<?php echo ($c_wr_content == "5") ? " checked" : "";?> required> 강원도
 
 

이 질문에 댓글 쓰기 :

답변 4


 <label for="wr_content_1"> <span class="sound_only">라디오박스</span></label>
            <input type="radio" id="wr_content_1" name="wr_content" value="6"<?php echo ($wr_content == "6") ? " checked" : "";?> required> 순서
            <input type="radio" id="wr_content_2" name="wr_content" value="1"<?php echo ($wr_content == "1") ? " checked" : "";?> required> 1
            <input type="radio" id="wr_content_3" name="wr_content" value="2"<?php echo ($wr_content == "2") ? " checked" : "";?> required> 2
            <input type="radio" id="wr_content_4" name="wr_content" value="3"<?php echo ($wr_content == "3") ? " checked" : "";?> required> 3
            <input type="radio" id="wr_content_5" name="wr_content" value="4"<?php echo ($wr_content == "4") ? " checked" : "";?> required> 4
            <input type="radio" id="wr_content_6" name="wr_content" value="5"<?php echo ($wr_content == "5") ? " checked" : "";?> required> 5
 
 

view_comment.skin.php 전체를 올려 보세요.

그누보드 최신 게시판 스킨  basic파일에서 

 



 <?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><?php } ?>

        <textarea id="wr_content" name="wr_content" required title="댓글 내용"

        <?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?php } ?> placeholder="댓글내용을 입력해주세요"><?php echo $c_wr_content; ?></textarea>

        <?php if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?php } ?>

 



이부분을 아래 라디오버튼으로 변경하고, 

 



     <label for="wr_content"> <span class="sound_only">지역구</span></label>

            <input type="radio" id="wr_content" name="wr_content" value="1"<?php echo ($c_wr_content == "1") ? " checked" : "";?> required> 1

            <input type="radio" id="wr_content" name="wr_content" value="2"<?php echo ($c_wr_content == "2") ? " checked" : "";?> required> 2

            <input type="radio" id="wr_content" name="wr_content" value="3"<?php echo ($c_wr_content == "3") ? " checked" : "";?> required> 3

            <input type="radio" id="wr_content" name="wr_content" value="4"<?php echo ($c_wr_content == "4") ? " checked" : "";?> required> 4

            <input type="radio" id="wr_content" name="wr_content" value="5"<?php echo ($c_wr_content == "5") ? " checked" : "";?> required> 5


 





하단 스크립트에서  아래 코드 삭제 

 

  if (char_min > 0 || char_max > 0)

        {

            check_byte('wr_content', 'char_count');

            var cnt = parseInt(document.getElementById('char_count').innerHTML);

            if (char_min > 0 && char_min > cnt)

            {

                alert("댓글은 "+char_min+"글자 이상 쓰셔야 합니다.");

                return false;

            } else if (char_max > 0 && char_max < cnt)

            {

                alert("댓글은 "+char_max+"글자 이하로 쓰셔야 합니다.");

                return false;

            }

        }

        else if (!document.getElementById('wr_content').value)

        {

            alert("댓글을 입력하여 주십시오.");

            return false;

        }

 

이것말고는 아무것도 손댄게 없습니다 

1번 라디오 버튼의 입력값 1만 입력이 나오질 않습니다 .
1로도 해보고 글자도 넣어보고 했는데 첫번째꺼만 댓글 입력하면 공백입니다. ㅜㅜ

 <label for="wr_content"> <span class="sound_only">라디오박스</span></label>
            <input type="radio" id="wr_content" name="wr_content" value="6"<?php echo ($wr_content == "6") ? " checked" : "";?> required> 순서
            <input type="radio" id="wr_content" name="wr_content" value="1"<?php echo ($wr_content == "1") ? " checked" : "";?> required> 1
            <input type="radio" id="wr_content" name="wr_content" value="2"<?php echo ($wr_content == "2") ? " checked" : "";?> required> 2
            <input type="radio" id="wr_content" name="wr_content" value="3"<?php echo ($wr_content == "3") ? " checked" : "";?> required> 3
            <input type="radio" id="wr_content" name="wr_content" value="4"<?php echo ($wr_content == "4") ? " checked" : "";?> required> 4
            <input type="radio" id="wr_content" name="wr_content" value="5"<?php echo ($wr_content == "5") ? " checked" : "";?> required> 5
 
 

 

이렇게 도 해봤는데요 

첫번째 라디오 버튼은 입력값이 나오질 않습니다. 

 

3547108491_1620888846.4973.png

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

회원로그인

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