주문하기시 정보 입력 부분 질문입니다.ㅠ

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
주문하기시 정보 입력 부분 질문입니다.ㅠ

QA

주문하기시 정보 입력 부분 질문입니다.ㅠ

본문

주문하기 페이지에서 정보 입력시 받으시는 분 정보할때 주문자와 동일이라는 라디오 버튼이 있는데

회원이 구매하기 페이지 이동하면 주문자와 동일이 체크되어져있고 밑에 있는 내용이 채워지게 하고싶은데... 현재는 버튼을 눌러야 되자나요 근데 그페이지 이동하자마자 바로 되게 하는방법이...;

 

[code]

<!-- 받으시는 분 입력 시작 { -->
    <!-- } 받으시는 분 입력 끝 -->
        <h2>받으시는 분</h2>

        <div class="tbl_frm01 tbl_wrap">
            <table>
            <tbody>
            <?php
            if($is_member) {
                // 배송지 이력
                $addr_list = '';

                // 주문자와 동일
                $addr_list .= '<input type="radio" name="ad_sel_addr" value="same"   id="ad_sel_addr_same" checked="checked">'.PHP_EOL;
                $addr_list .= '<label for="ad_sel_addr_same">주문자와 동일</label>'.PHP_EOL;

               
                // 최근배송지
               

                $addr_list .= '<input type="radio" name="ad_sel_addr" value="new" id="od_sel_addr_new">'.PHP_EOL;
                $addr_list .= '<label for="od_sel_addr_new">신규배송지</label>'.PHP_EOL;

            } else {
                // 주문자와 동일
                $addr_list .= '<input type="checkbox" name="ad_sel_addr" value="same" id="ad_sel_addr_same">'.PHP_EOL;
                $addr_list .= '<label for="ad_sel_addr_same">주문자와 동일</label>'.PHP_EOL;
            }
            ?>
            <tr>
                <th scope="row">배송지선택</th>
                <td>
                    <?php echo $addr_list; ?>
                </td>
            </tr>
           
            <tr>
                <th scope="row"><label for="od_b_name">이름<strong class="sound_only"> 필수</strong></label></th>
                <td><input type="text" name="od_b_name" id="od_b_name" required class="frm_input required" maxlength="20"></td>
            </tr>
            <tr>
                <th scope="row"><label for="od_b_tel">전화번호<strong class="sound_only"> 필수</strong></label></th>
                <td><input type="text" name="od_b_tel" id="od_b_tel" required class="frm_input required" maxlength="20"></td>
            </tr>
            <tr>
                <th scope="row"><label for="od_b_hp">핸드폰</label></th>
                <td><input type="text" name="od_b_hp" id="od_b_hp" value="<?php echo $row['mb_hp'];?>" class="frm_input" maxlength="20"></td>
            </tr>
            <tr>
                <th scope="row">주소</th>
                <td id="sod_frm_addr">
                    <label for="od_b_zip" class="sound_only">우편번호<strong class="sound_only"> 필수</strong></label>
                    <input type="text" name="od_b_zip" id="od_b_zip" required class="frm_input required" size="5" maxlength="6">
                    <button type="button" class="btn_frmline" onclick="win_zip('forderform', 'od_b_zip', 'od_b_addr1', 'od_b_addr2', 'od_b_addr3', 'od_b_addr_jibeon');">주소 검색</button><br>
                    <input type="text" name="od_b_addr1" id="od_b_addr1" required class="frm_input frm_address required" size="60">
                    <label for="od_b_addr1">기본주소<strong class="sound_only"> 필수</strong></label><br>
                    <input type="text" name="od_b_addr2" id="od_b_addr2" class="frm_input frm_address" size="60">
                    <label for="od_b_addr2">상세주소</label>
                    <br>
                    <input type="text" name="od_b_addr3" id="od_b_addr3" readonly="readonly" class="frm_input frm_address" size="60">
                    <label for="od_b_addr3">참고항목</label><br>
                    <input type="hidden" name="od_b_addr_jibeon" value="">
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="od_memo">전하실말씀</label></th>
                <td><textarea name="od_memo" id="od_memo"></textarea></td>
            </tr>
            </tbody>
            </table>
        </div>
    </section>
    <!-- } 받으시는 분 입력 끝 -->​

 

 

 

 

// 배송지선택
     $("input[name=ad_sel_addr]").on("click", function() {

        var addr = $(this).val().split(String.fromCharCode(30));

        if (addr[0] == "same") {
            if($(this).is(":checked"))
                gumae2baesong(true);
            else
                gumae2baesong(false);
        } else {
            if(addr[0] == "new") {
                for(i=0; i<10; i++) {
                    addr[i] = "";
                }
            }

            var f = document.forderform;
            f.od_b_name.value        = addr[0];
            f.od_b_tel.value         = addr[1];
            f.od_b_hp.value          = addr[2];
            f.od_b_zip.value         = addr[3] + addr[4];
            f.od_b_addr1.value       = addr[5];
            f.od_b_addr2.value       = addr[6];
            f.od_b_addr3.value       = addr[7];
            f.od_b_addr_jibeon.value = addr[8];
            f.ad_subject.value       = addr[9];

            var zip1 = addr[3].replace(/[^0-9]/g, "");
            var zip2 = addr[4].replace(/[^0-9]/g, "");

            if(zip1 != "" && zip2 != "") {
                var code = String(zip1) + String(zip2);

                if(zipcode != code) {
                    zipcode = code;
                    calculate_sendcost(code);
                }
            }
        }
    });​

[code]

 

 

6408ca90febc67266c3ed0278a89529a_1438673281_4956.png
 

이 질문에 댓글 쓰기 :

답변 1


$("input[name=ad_sel_addr]").on("click", function() {

 

이부분을​ 바꾸시면됩니다ㅇㅇ 어떤식으로?

 


$(function() {
 

 

이런식으로ㅇㅇ;

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

회원로그인

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