From 3a6808df49c5b6a6cecf9f8a51f5208a3be89d8a Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 4 Jun 2013 17:25:59 +0900 Subject: [PATCH] =?UTF-8?q?#214=20select=20=EB=B3=80=EA=B2=BD=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/couponform.php | 72 +++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 25 deletions(-) diff --git a/adm/shop_admin/couponform.php b/adm/shop_admin/couponform.php index 19d8f2782..5cc3d5e57 100644 --- a/adm/shop_admin/couponform.php +++ b/adm/shop_admin/couponform.php @@ -52,7 +52,7 @@ include_once (G4_ADMIN_PATH.'/admin.head.php'); - + + @@ -149,38 +151,27 @@ $(function() { $("#tr_cp_trunc").hide(); + $("#cp_method_btn").click(function() { + var cp_method = $("#cp_method").val(); + change_method(cp_method); + }); + $("#cp_type_btn").click(function() { + var cp_type = $("#cp_type").val(); + change_type(cp_type); + }); + + /** select 변경때 반영하려면 주서 제거 $("#cp_method").change(function() { var cp_method = $(this).val(); - $("#sch_target_frm").hide(); - if(cp_method == "0") { - $("#sch_target").text("상품검색"); - $("#tr_cp_target").find("label").text("적용상품"); - $("#tr_cp_target").find("input").attr("required", true).addClass("required"); - $("#tr_cp_target").show(); - } else if(cp_method == "1") { - $("#sch_target").text("분류검색"); - $("#tr_cp_target").find("label").text("적용분류"); - $("#tr_cp_target").find("input").attr("required", true).addClass("required"); - $("#tr_cp_target").show(); - } else { - $("#tr_cp_target").hide(); - $("#tr_cp_target").find("input").attr("required", false).removeClass("required"); - } + change_method(cp_method); }); $("#cp_type").change(function() { var cp_type = $(this).val(); - if(cp_type == "0") { - $("#cp_amount_unit").text("원"); - $("#cp_amount_unit").closest("tr").find("label").text("할인금액"); - $("#tr_cp_trunc").hide(); - } else { - $("#cp_amount_unit").text("%"); - $("#cp_amount_unit").closest("tr").find("label").text("할인비율"); - $("#tr_cp_trunc").show(); - } + change_type(cp_type); }); + */ $("#sch_target").click(function() { var cp_method = $("#cp_method").val(); @@ -208,6 +199,37 @@ $(function() { }); }); +function change_method(cp_method) +{ + if(cp_method == "0") { + $("#sch_target").text("상품검색"); + $("#tr_cp_target").find("label").text("적용상품"); + $("#tr_cp_target").find("input").attr("required", true).addClass("required"); + $("#tr_cp_target").show(); + } else if(cp_method == "1") { + $("#sch_target").text("분류검색"); + $("#tr_cp_target").find("label").text("적용분류"); + $("#tr_cp_target").find("input").attr("required", true).addClass("required"); + $("#tr_cp_target").show(); + } else { + $("#tr_cp_target").hide(); + $("#tr_cp_target").find("input").attr("required", false).removeClass("required"); + } +} + +function change_type(cp_type) +{ + if(cp_type == "0") { + $("#cp_amount_unit").text("원"); + $("#cp_amount_unit").closest("tr").find("label").text("할인금액"); + $("#tr_cp_trunc").hide(); + } else { + $("#cp_amount_unit").text("%"); + $("#cp_amount_unit").closest("tr").find("label").text("할인비율"); + $("#tr_cp_trunc").show(); + } +} + function form_check(f) { var sel_type = f.cp_type;