diff --git a/src/main/webapp/WEB-INF/jsp/oprtn/cndtnSspnIdtmt/trgtDplctChk.jsp b/src/main/webapp/WEB-INF/jsp/oprtn/cndtnSspnIdtmt/trgtDplctChk.jsp index 30d360ad..7074d92a 100644 --- a/src/main/webapp/WEB-INF/jsp/oprtn/cndtnSspnIdtmt/trgtDplctChk.jsp +++ b/src/main/webapp/WEB-INF/jsp/oprtn/cndtnSspnIdtmt/trgtDplctChk.jsp @@ -43,6 +43,9 @@ return false; } + //생년월일 치환 + $("#DBirth").val($("#birthYear").val()+$("#birthMonth").val()+$("#birthDay").val()); + var data = new FormData(document.getElementById("createForm")); // if(confirm("저장하시겠습니까?")){ @@ -125,22 +128,23 @@ return true; } - // 생년월일 검사 - if($("#DBirth").val().trim() == ""){ - alert("생년월일을 입력해주세요."); - $("#DBirth").focus(); - return true; - }else{ - $("#DBirth").val($("#DBirth").val().replaceAll('.','')) - } - - //생년월일 자리수 검사 - if($("#DBirth").val().length != 8){ - alert("생년월일은 반드시 8자리를 맞춰주세요.\nex)20010102"); - $("#DBirth").focus(); - return true; - } - + if($("#birthYear").val() == ''){ + alert('생년월일 년도를 선택해주세요.'); + $("#birthYear").focus(); + return true; + }; + if($("#birthMonth").val() == ''){ + alert('생년월일 월을 선택해주세요.'); + $("#birthMonth").focus(); + return true; + }; + if($("#birthDay").val() == ''){ + alert('생년월일 일자를 선택해주세요.'); + $("#birthDay").focus(); + return true; + }; + + return false; // 모든 검사를 통과하면 false 반환 @@ -152,6 +156,77 @@ listForm.submit(); } + function birthSelectBoxDraw(){ + $('.birthYear').yearselect({ + start : 1900, + end : new Date().getFullYear(), + emptyOption: true, + emptyText: '선택', + selected:'', + order:'desc' + }) + // 년도를 바꾼다면 일자를 다시 선택하기 + $('.birthYear').change(function(){ + if($(this).next().next().next().next('select.birthDay')){ + if(Number($(this).next().next().next().next('select.birthDay').val()) > 28){ + dayDraw($(this).next().next().next().next('select.birthDay')); + } + } + }); + + $.each($(".birthMonth"), function(idx, elm){ + var selectValue = $(this).attr('selectValue'); + $(this).append($(''); + var month = i+1; + month = month < 10 ? '0'+month : month; + option.val(month); + option.text(month+'월'); + $(this).append(option); + } + + if(isNotEmpty(selectValue)){ + $(this).val(selectValue); + } + + // 일자가 존재한다면.. + if($(this).next().next('select.birthDay')){ + $(this).change(function(){ + dayDraw($(this).next().next('select.birthDay')); + }); + } + }); + + $.each($(".birthDay"), function(idx, value){ + dayDraw($(this)); + }); + } + function dayDraw(obj){ + var selectValue = $(obj).attr('selectValue'); + var selectMonth = $(obj).prev().prev('select.birthMonth').val(); + var selectYear = $(obj).prev().prev().prev().prev('select.birthYear').val(); + var lastDay = ''; + if(isNotEmpty(selectMonth) && isNotEmpty(selectYear)){ + lastDay = new Date(selectYear, selectMonth, 0).getDate(); + } + $(obj).children('option').remove(); + $(obj).append($(''); + var day = i+1; + day = day < 10 ? '0'+day : day; + + option.val(day); + option.text(day+'일'); + $(obj).append(option); + } + if(isNotEmpty(selectValue)){ + $(obj).val(selectValue); + } + } + } @@ -162,6 +237,7 @@ + @@ -222,9 +298,14 @@
거래선 및 서약서 정보1
+거래선 및 서약서 정보