본문 바로가기

Developer/Javascript

onClick 함수 폼

function onClick(code) {

	switch(code) {

		case "NTC_SEARCH" :

			$("#nowPage").val(1);

			$("#noticeListForm").attr("action", '');

			$("#noticeListForm").submit();

			break;

		case "NTC_TODAY" :

			var tDay = getFormatDate(getToday(), '2');
	
			$("#bgnDt").val(tDay);

			$("#endDt").val(tDay);

			break;

		case "NTC_WEEK" :

			var weekDate = getWeekDate();

			$("#bgnDt").val(weekDate[1]);

			$("#endDt").val(weekDate[5]);

			break;

		case "NTC_MONTH" :

			var sp = new Array();

			var yearMonth = getFormatDate(getToday(), '3');

			var sp = yearMonth.split("/");

			var firstDate = yearMonth + "/01";

			var lastDate = yearMonth + "/"+getMonthEndDate(sp[0], sp[1]);

	
			$("#bgnDt").val(firstDate);

			$("#endDt").val(lastDate);

	
			break;

		case "NTC_RESET" :

			$("#bgnDt").val("");

			$("#endDt").val("");

			$("#schValue").val("");

			break;

	}

	

}

'Developer > Javascript' 카테고리의 다른 글

스크롤이 맨끝으로 갔을 때 이벤트 처리  (0) 2017.12.27
검색 엔터키 처리  (0) 2017.12.27
날짜 관련함수  (0) 2017.12.27
Date format 변경 함수  (0) 2017.12.26
용어  (0) 2017.11.12