自訂 - 西元年月日
元件:datepicker001
元件參數需設定
西元年:data-date-format="us"
模式:data-date-mode="custom"
最小日:data-min-date="YYYY/MM/DD"
最大日:data-max-date="YYYY/MM/DD"
data-date-mode="custom"
預設為:今天
Default
Preview
請輸入或選擇西元年、月、日
HTML
    
<div class="tw-form-group  ">
    <div datepicker001 data-max-date="2024/04/30" data-min-date="2024/04/1" data-date-mode="custom" data-date-mode="custom" data-date-format="us" data-plugin="comp/datepicker001,datepicker" data-type="comp" data-comp-name="datepicker001" class="tw-form-wrap  tw-relative tw-bg-white">
        <input type="tel" datepicker001Input name="usCustom" id="usCustom" autocomplete="off" class="tw-form-input" placeholder="西元 0000 / 00 / 00" onchange="doCheckDate(event);" onblur="doCheckDate(event);">
        <div class=" tw-h-24 tw-border-l tw-border-neutral-300 tw-pl-16">
        <button datepicker001Trigger type="button" class="tw-h-24 tw-w-24 tw-transition-opacity tw-will-change-opacity hover:tw-opacity-30 active:tw-opacity-30">
            <img src="/img/icons/grey-calendar.svg" />
        </button>
        </div>
        <!-- dropdown -->
        <input type="hidden" name="usCustomStore" id="usCustomStore" datepicker001InputStore />
        <div datepicker001Panel style="display: none" class="tw-absolute tw-top-44 tw-z-90 tw-w-[360px] tw-rounded-12 tw-bg-white tw-shadow-2 md:tw-right-0 lg:tw-left-0 lg:tw-right-auto">
        <div class="tw-relative tw-flex tw-h-[486px] tw-w-[360px] tw-flex-col tw-divide-y tw-divide-neutral-variant-200">
            <div class="tw-pt-16">
            <div class="tw-flex tw-items-center tw-px-24">
                <div class="tw-body-m tw-leading-none tw-text-neutral-900">選擇日期</div>
                <button datepicker001CloseBtn type="button" class="tw-ml-auto tw-h-20 tw-w-20 tw-transition-opacity tw-duration-100 tw-will-change-opacity hover:tw-opacity-30 active:tw-opacity-30">
                <img src="/img/icons/black-close.svg" />
                </button>
            </div>
            <div yearSelectWrap class="tw-novalidate tw-mt-20 tw-px-24 tw-pb-16">
                <select multiple data-placeholder="請選擇" data-search="false"></select>
            </div>
            <div yearTabWrap class="tw-mt-20">
                <div yearTab class="tw-relative tw-flex tw-justify-center">
                <div yearTabBg class="tw-absolute tw-bottom-0 tw-left-0 tw-h-4 tw-w-0 tw-rounded-4 tw-bg-primary-200 tw-transition-[left,width] tw-duration-200"></div>
                <button yearTabItem data-category="" type="button" aria-selected="false" class="tw-relative tw-grow tw-px-16 tw-py-10 tw-text-neutral-variant-600 tw-transition-colors tw-duration-300 tw-will-change-colors hover:tw-text-neutral-variant-800 active:tw-text-neutral-variant-800">
                    <div class="tw-h4 tw-font-medium"></div>
                </button>
                <button yearTabItem data-category="" type="button" aria-selected="false" class="tw-relative tw-grow tw-px-16 tw-py-10 tw-text-neutral-variant-600 tw-transition-colors tw-duration-300 tw-will-change-colors hover:tw-text-neutral-variant-800 active:tw-text-neutral-variant-800">
                    <div class="tw-h4 tw-font-medium"></div>
                </button>
                </div>
            </div>
            </div>
            <div class="tw-px-12">
            <div datepicker001Container></div>
            <button datepicker001Submit type="button" class="tw-btn-primary tw-mt-4 tw-w-full">確認</button>
            </div>
        </div>
        </div>
    </div>
    <div class="tw-form-hint tw-caption tw-mt-2 tw-px-16 tw-text-neutral-600">請輸入或選擇西元年、月、日</div>
    <div class="tw-form-error-msg tw-mt-2 tw-px-16"></div>
</div>

  
Default Value
格式:YYYY / MM / DD ("/"前後,需有空格)

<input type="tel" datepicker001Input name="usCustom2" id="usCustom2" autocomplete="off" class="tw-form-input" placeholder="西元 0000 / 00 / 00" value="2024 / 04 / 20">
                          
Preview
請輸入或選擇西元年、月、日
HTML

<div class="tw-form-group  ">
    <div datepicker001 data-max-date="2024/04/30" data-min-date="2024/04/1" data-date-mode="custom" data-date-mode="custom" data-date-format="us" data-plugin="comp/datepicker001,datepicker" data-type="comp" data-comp-name="datepicker001" class="tw-form-wrap  tw-relative tw-bg-white">
        <input type="tel" datepicker001Input name="usCustom2" id="usCustom2" autocomplete="off" class="tw-form-input" value="2024 / 04 / 20" placeholder="西元 0000 / 00 / 00" onchange="doCheckDate(event);" onblur="doCheckDate(event);">
        <div class=" tw-h-24 tw-border-l tw-border-neutral-300 tw-pl-16">
        <button datepicker001Trigger type="button" class="tw-h-24 tw-w-24 tw-transition-opacity tw-will-change-opacity hover:tw-opacity-30 active:tw-opacity-30">
            <img src="/img/icons/grey-calendar.svg" />
        </button>
        </div>
        <!-- dropdown -->
        <input type="hidden" name="usCustom2Store" id="usCustom2Store" datepicker001InputStore />
        <div datepicker001Panel style="display: none" class="tw-absolute tw-top-44 tw-z-90 tw-w-[360px] tw-rounded-12 tw-bg-white tw-shadow-2 md:tw-right-0 lg:tw-left-0 lg:tw-right-auto">
        <div class="tw-relative tw-flex tw-h-[486px] tw-w-[360px] tw-flex-col tw-divide-y tw-divide-neutral-variant-200">
            <div class="tw-pt-16">
            <div class="tw-flex tw-items-center tw-px-24">
                <div class="tw-body-m tw-leading-none tw-text-neutral-900">選擇日期</div>
                <button datepicker001CloseBtn type="button" class="tw-ml-auto tw-h-20 tw-w-20 tw-transition-opacity tw-duration-100 tw-will-change-opacity hover:tw-opacity-30 active:tw-opacity-30">
                <img src="/img/icons/black-close.svg" />
                </button>
            </div>
            <div yearSelectWrap class="tw-novalidate tw-mt-20 tw-px-24 tw-pb-16">
                <select multiple data-placeholder="請選擇" data-search="false"></select>
            </div>
            <div yearTabWrap class="tw-mt-20">
                <div yearTab class="tw-relative tw-flex tw-justify-center">
                <div yearTabBg class="tw-absolute tw-bottom-0 tw-left-0 tw-h-4 tw-w-0 tw-rounded-4 tw-bg-primary-200 tw-transition-[left,width] tw-duration-200"></div>
                <button yearTabItem data-category="" type="button" aria-selected="false" class="tw-relative tw-grow tw-px-16 tw-py-10 tw-text-neutral-variant-600 tw-transition-colors tw-duration-300 tw-will-change-colors hover:tw-text-neutral-variant-800 active:tw-text-neutral-variant-800">
                    <div class="tw-h4 tw-font-medium"></div>
                </button>
                <button yearTabItem data-category="" type="button" aria-selected="false" class="tw-relative tw-grow tw-px-16 tw-py-10 tw-text-neutral-variant-600 tw-transition-colors tw-duration-300 tw-will-change-colors hover:tw-text-neutral-variant-800 active:tw-text-neutral-variant-800">
                    <div class="tw-h4 tw-font-medium"></div>
                </button>
                </div>
            </div>
            </div>
            <div class="tw-px-12">
            <div datepicker001Container></div>
            <button datepicker001Submit type="button" class="tw-btn-primary tw-mt-4 tw-w-full">確認</button>
            </div>
        </div>
        </div>
    </div>
    <div class="tw-form-hint tw-caption tw-mt-2 tw-px-16 tw-text-neutral-600">請輸入或選擇西元年、月、日</div>
    <div class="tw-form-error-msg tw-mt-2 tw-px-16"></div>
</div>
                        
Set Value
格式:YYYY / MM / DD ("/"前後,需有空格)
Preview
請輸入或選擇西元年、月、日
JS

<button type="button" class="tw-btn-small-primary" onclick="setValueToCustom3('2024 / 04 / 01');">設定2024 / 04 / 01</button>
                                                    

<button type="button" class="tw-btn-small-primary" onclick="setValueToCustom3('2024 / 04 / 21');">設定2024 / 04 / 21</button>
                                                    

<script>
  function setValueToCustom3(value){
    let target
    target = document.querySelector('[name=usCustom3]')
    //use jquery to get element
    //target = $('[name=usCustom3]').get(0);
    target.setValue(value)
  }
</script>
                                                    
Validate Code Reference
請依照實際開發狀況調整
JS

<script>
    function doCheckDate(event) {
        const targetElm = event.target;
        const value = targetElm.value.trim();
        const date = new Date(value);
        const dateFormatRegex = /^\d{4}\s*\/\s*\d{2}\s*\/\s*\d{2}$/;
        if (value === '') {
            setInputStatus(targetElm, 'error', '請輸入資料');
        } else if (!dateFormatRegex.test(value)) {
            setInputStatus(targetElm, 'error', '日期格式應為 YYYY / MM / DD');
        } else if (isNaN(date) || date === 'Invalid Date') {
            setInputStatus(targetElm, 'error', '請輸入有效的日期');
        } else {
            setInputStatus(targetElm, 'success');
        }
    }
</script>
                                                    
會員登入
網路會員可直接登入,加速您投保流程
請使用「新式居留證統一證號」重新註冊會員,或前往移民署換發中華民國居留證以取得新證號。若持舊式居留證,為避免保險中斷,請親自前往本公司服務據點辦理重新投保。
dsdsdsdsdss
保存試算
請提供聯繫資料,以便寄送本次試算內容連結。透過專屬連結回官網投保,無需重新輸入資料,且可享有線上投保優惠,有效期限至2024/01/10中午12:00止
請輸入收件者名稱
請輸入收件者的手機號碼
請輸入收件者的電子信箱
繼續投保
請輸入身分證/居留證號碼
請輸入共16碼數字
僅供於本站保存試算過的客戶使用。
您要繼續使用嗎?
為了您的資料安全,系統會將一段時間未使用者登出,若仍需使用請點選「繼續使用」,否則將於24秒後自動登出。
選擇日期
手機截圖縮小教學
手機截圖方法
步驟1. 於相簿中打開欲上傳的要保書照片或PDF檔
步驟2. 擷取手機螢幕上的畫面
步驟3. 上傳擷取後的相片
適用iPhone X/XR/XS 或以上機型
同時按下「電源鍵」與左邊的「上音量鍵」擷取螢幕
適用iPhone 6/7/8/SE 等機型
同時按下「電源鍵」與「Home 鍵」擷取螢幕
COSTCO會員卡驗證
如何查詢卡號
COSTCO金星或商業會員卡
共11碼
COSTCO聯名卡
共11碼
若您有任何疑問,請撥打好市多客服電話:(02)449-9909