Hi Guys,
I created a datepicker in the website events module and it works fine in browsers (ie, chrome, firefox)
but in the mobile version it doesn't show a calendar and it doesn't run ajax options.
Can anyone help me or have been through this
This is my code.
"input type="text" id="datePicker" name ="datePicker" placeholder="DD/MM/YYYY""
my JS Code:
$(document).ready(function () {
$("#datePicker")
.datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "dd/mm/yy"
});
$('#datePicker').change(function () {
var date = $('#datePicker').val();
var today = new Date();
var event_id = document.getElementById("evt_id").innerText;
today = moment(today).format("YYYY-MM-DD");
console.log(today);
console.log(date);
if (date >= today) {
var i;
var element_div = $("#ticketsAssents");
ajax.jsonRpc("/shop/dateevent", 'call', {
'b_date': date,'event_id':event_id
}).then(function (data) {
element_div.empty();
if (data.length > 0) {
for (i = 0; i < data.length; i++) {
alert("Its Ok");
}
}
});
return true
}
});