채택완료

쿠폰관리 페이지의 상품검색 기능

2017-01-07 (토) 21:47:22 7,054

관리자 페이지의 쿠폰관리 페이지에 있는 상품검색 기능을 게시판에 넣을려고 합니다.

그런데 write.skin.php 파일에 아래의 스크립트와 코드를 그대로 붙혀 넣어도 팝업창이 열리지가 않네요.

    <tr id="tr_cp_target">
        <th scope="row"><label for="cp_target">상품검색</label></th>
        <td>
           <input type="text" name="cp_target" value="<?php echo stripslashes($cp['cp_target']); ?>" id="cp_target" required class="required frm_input">
           <button type="button" id="sch_target" class="btn_frmline">상품검색</button>
        </td>
    </tr>

스크립트

$(function() {

    $("#sch_target").click(function() {
        var cp_method = $("#cp_method").val();
        var opt = "left=50,top=50,width=520,height=600,scrollbars=1";
        var url = "./item_popup.php?sch_target=";

        if(cp_method == "0") {
            window.open(url+"0", "win_target", opt);
        } else if(cp_method == "1") {
            window.open(url+"1", "win_target", opt);
        } else {
            return false;
        }
    });
});

뭐가 잘못되었는지 알 수 있을까요? 

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트

cp_method 라는 id를 가지는 input 폼을 만들어서 거기에 0 또는 1값이 있어야 팝업창이 오픈되는 스크립트입니다. 

답변에 대한 댓글 1개

감사합니다. 덕분에 간단하게 해결할 수 있었습니다.^^

답변을 작성하려면 로그인이 필요합니다.