/ / On Onchange dans les plugins jQuery de XDSoft DateTime Picker - javascript, jquery

Événement On Onchange dans les plugins jQuery de XDSoft Sélecteur DateTime - javascript, jquery

Voici mon codage pour l'événement onchange dans les plugins jQuery par XDSoft DateTime Picker

<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>

Réponses:

1 pour la réponse № 1

Utiliser les rappels disponibles à partir de Le document

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

Alors, votre code devient:

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

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

1 pour la réponse № 2
 $(function () {

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