2
我不知道如何使用函數來設置日期輸入(彈出日期選擇器)的選定日期,並在下面的日曆(內聯日期選擇器)中設置該日期。我已經看到了這個功能來設置它:_setDate
或_setDateDatepicker
,但我不知道如何實現它。請,如果有人能幫助我,我將不勝感激。如何在jQuery Mobile 1.4 Datepicker中創建事件?
$.datepicker.setDefaults({
showOn: "both",
showWeek: true,
firstDay: 1,
dateFormat: 'dd/mm/yy',
maxDate: '+0',
selectOtherMonths: true,
regional: 'uk',
monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
<body>
<h2>Popup Datepicker</h2>
<div data-demo-html="true">
<input type="date" id="date_val" data-role="datebox" style="margin-top: 10px" data-options='{"mode": "calbox", "useNewStyle":true,"useFocus": true}'>
</div>
Evento:
<input type="text" id="event" name="event">
<input type="button" id="btn" value=" Enviar " onClick="myFunction()">
<h2>Inline Datepicker</h2>
<div data-demo-html="true">
<input type="text" id="cal" data-role="date" data-inline="true">
</div>
您是否找到了解決方案?我也需要實現'onSelect',但仍然沒有任何線索。 – 2017-02-01 09:31:05