datepicker 관련질문

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
datepicker 관련질문

QA

datepicker 관련질문

본문

1995112978_1698831187.6847.png데이터피커 관련 질문입니다 데이터피커 초점이 탭으로만 이동해야 되서 만들었는데 전년도를 선택하고나서 날짜로 초점이 가야하는데 나가집니다 어떤 문제일까요?

정확히는 초점이 인풋으로 가집니다 월이나 년도로 탭이 가져야합니다

이 질문에 댓글 쓰기 :

답변 2

다음 코드가 도움이 될지 모르겠습니다.


$(function () {
    $('.datepicker').datepicker({
        ...
        minDate: '-20Y',
        yearRange: '-20:+0',
        beforeShow: function (el, obj) {
            setTimeout(function () {
                obj.dpDiv.find('.ui-datepicker-month').focus();
            }, 1);
        }
    });
    // dayTripper();
});

3699061436_1698880014.627.png


<!DOCTYPE html>
<html>
<head>
  <!-- 여기에 데이터피커 관련 스크립트 및 스타일 시트를 추가하세요. -->
</head>
<body>
  <label for="yearInput">년도:</label>
  <input type="text" id="yearInput">
  
  <label for="monthInput">월:</label>
  <input type="text" id="monthInput">

  <script>
    // 데이터피커 관련 스크립트를 초기화 및 설정하는 코드
    // 이 코드는 데이터피커 라이브러리에 따라 다를 수 있습니다.

    // "년도" 입력 필드
    const yearInput = document.getElementById("yearInput");

    // "월" 입력 필드
    const monthInput = document.getElementById("monthInput");

    // "년도" 입력 필드의 이벤트 핸들러
    yearInput.addEventListener("change", function () {
      // "년도" 입력 필드가 변경되면 "월" 입력 필드로 초점 이동
      monthInput.focus();
    });
  </script>
</body>
</html>

답변을 작성하시기 전에 로그인 해주세요.
전체 47
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT