$(function() { $("#firBtn").bind("input",function() { sedata = "&data="+$(this).val(); $("#firSel").empty(); $.get("IdcGetServerYJSON.jso",sedata,function(data) { for(var i=0;i"); var a=$(""); a.attr("value",data[i][0]).html(data[i][0]).addClass("btn btn-default"). attr({"price":data[i][1], "spec":data[i][2], "ram":data[i][3], "hdd":data[i][4]}); li.append(a); $("#firSel").append(li); } }); $("#firSel").show(); }); $(document).on("click","#firSel > li > a",function() { var span = $(""); span.addClass("caret"); //$("#firBtn").html($(this).html()+" ").append(span); $("#firBtn").val($(this).html()); $("#cs_code").val($(this).html().split("-")[1]); $("#server_code").val($(this).attr("value")); $("#amount_cpu").val($(this).attr("price")); $("#hidden_amount_cpu").val($(this).attr("price")); $("#specramhdd").val($(this).attr("spec")+" / "+$(this).attr("ram")+" / "+$(this).attr("hdd")); clickTest(); InCs(); $("#firSel").hide(); }); //vpn선택시 vpn등록으로 이동 $("#service_line").change(function(){ var service_line = $(this).val(); var client_code =$(this).attr("client_code"); if(service_line == 'vpn'){ window.location = "vpnWriteForm.sev?client_code="+client_code; }else if(service_line == 'substitution' || service_line == 'test'){ $("#amount_rack").val("0"); $("#amount_line").val("0"); $('#service_defence').val("x"); $('#amount_defence').val("0"); $("#amount_cpu").val("0"); }else if(service_line == 'defence'){ //장비임대 가격 원래대로 $("#amount_cpu").val($("#hidden_amount_cpu").val()); $('#service_defence').val("normal"); $('#amount_defence').val("400000"); clickTest(); }else{ //장비임대 가격 원래대로 $("#amount_cpu").val($("#hidden_amount_cpu").val()); $("#amount_rack").val("100000"); $("#amount_line").val("300000"); $('#service_defence').val("x"); $('#amount_defence').val("0"); $("#defence_discount").val("0"); } }); }); var f = document.frm; //cs넣기 var InCs = function() { var temp = $(".CSInput"); for(var i=0; i= service_cost){ alert("총 할인 금액이 서버 금액 보다 클 수 없습니다."); document.getElementById("amount_authority").value = "0"; document.getElementById("amount_contact").value = "0"; clickTest(); } } //일할 과금이 서버 금액보다 크면 안됨 function validateDeduction(){ var service_cost = (parseInt(document.getElementById("service_cost").value)||0); var service_deduction = (parseInt(document.getElementById("service_deduction").value)||0); if( service_deduction > service_cost){ alert("일할 과금 금액이 서버 금액 보다 클 수 없습니다."); document.getElementById("service_deduction").value = "0"; clickTest(); } } function validateTest(){ //아이피 입력 부분 유효성 테스트 var ip_count = parseInt(document.getElementById("ip_count").value); var getIP=$(".getIP"); //alert(getIP[0].value); for(var i=0;i