Skip to Content
Menu
This question has been flagged

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
    }
});
Avatar
Discard
Related Posts Replies Views Activity
2
Jul 17
3191
0
Jan 17
3569
0
Aug 15
2737
5
Jul 23
16479
1
Jul 22
1576