Answer the question
In order to leave comments, you need to log in
How to send data with ajax datetimepicker bootstrap?
I have a calendar on the page
<div class="form-group">
<!-- элемент input с id = datetimepicker1 -->
<div class="input-group" id="datetimepicker1">
<input type="text" class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
$(function () {
$('#datetimepicker1').datetimepicker(
{format: 'DD.MM.YYYY', locale: 'ru'}
);
$('#datetimepicker1').on("dp.change", function ()
{
var a = $("#datetimepicker1").data("datetimepicker").getDate();
$.ajax(
{
url:'index.php?r=category/viewdoc',
data: a,
type: 'GET',
success: function (res) {
console.log(res);
},
error:function () {
alert('Error');
}
}
);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question