/ / on OnchangeイベントXDSoftのDateTime PickerによるjQueryプラグインで - javascript、jquery

XDSoft DateTime PickerによるjQueryプラグインでのOnchangeイベント - javascript、jquery

XDSoft DateTime PickerによるjQueryプラグインのonchangeイベントのコーディングです

<input type="text" data-format="dd/MM/yyyy hh:mm:ss" class="form-control" id="txtdatetime">
<script type="text/javascript">
$(function () {
jQuery("#txtdatetime").datetimepicker({
startDate: "+1971/05/01",
format: "d.m.Y H:i",
onChangeDateTime: function () {
alert("yup");
}
});
});
</script>

回答:

回答№1は1

から利用可能なコールバックを使用する ドクター

onSelectDate: function () {},
onSelectTime: function () {},
onChangeMonth: function () {},
onChangeYear: function () {},
onChangeDateTime: function () {}, //the one you"re after
onShow: function () {},
onClose: function () {},
onGenerate: function () {}

したがって、コードは次のようになります。

$(function () {
$("#txtdatetime").datetimepicker({
startDate: "+1971/05/01",
format: "d.m.Y H:i",
onChangeDateTime: myfunction
});
});

function myfunction() {
alert("yup");
}

回答№2の場合は1
 $(function () {

jQuery("#txtdatetime").datetimepicker({
startDate: "+1971/05/01",
format: "d.m.Y H:i",
onChangeDateTime: function () {
//fire what you want
}
});
});