Daterangepicker is Not working in foreach loop

This my jQuery code in WordPress site. Its works well but when I run in the for-each loop its not works. I saw other answers but I can’t understand.

             jQuery(function() {
                     autoUpdateInput: false,
                     locale: {
                         cancelLabel: 'Cancel'
                 jQuery('#datepicker').on('apply.daterangepicker', function(ev, picker) {
                     $(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));
                 jQuery('#datepicker').on('cancel.daterangepicker', function(ev, picker) {


foreach ($query as $row) 
    {   ?>

            <form action="">
                <div class="form-group"> 
                    <label>Check-in / Out</label>
                    <input type="text" class="form-control" id="datepicker" name="datefilter" placeholder="Check-in / Out">


Read more here: Daterangepicker is Not working in foreach loop

Leave a Reply

Your email address will not be published. Required fields are marked *