弹出窗口中有多个日期选择器

时间:2019-02-11 16:34:15

标签: javascript jquery datepicker

我正在努力在朋友创建的页面上使用datepicker。这是他用来收取弹出窗口日期选择器要求的功能。

$.post(
    '/admin/clients/modal_fiche_prospect_ajax',
    {
        cid: cid
    },
    function( res ){
        modal.find('.modal-title').text(cname);
        modal.find('.modal-body').html(res);

        //content pour le popover
        $.post(
            '/admin/clients/popover_ajax',
            { cid : cid },
            function( res ){
                $('[data-toggle="popover"]').popover({ content: res });
                $('#myActionActiondate').bootstrapMaterialDatePicker({
                    time: true,
                    weekStart: 1,
                    format : 'DD/MM/YYYY HH:mm', 
                    lang : 'fr',  
                    cancelText : 'ANNULER'
                });
            }
        );
    }
);
})

我正在尝试在弹出窗口上进行第二次日期选择,所以我尝试了许多这样的尝试:

    $.post(
    '/admin/clients/modal_fiche_prospect_ajax',
    {
        cid: cid
    },
    function( res ){
        modal.find('.modal-title').text(cname);
        modal.find('.modal-body').html(res);

        //content pour le popover
        $.post(
            '/admin/clients/popover_ajax',
            { cid : cid },
            function( res ){
                $('[data-toggle="popover"]').popover({ content: res });
                $('#myActionActiondate').bootstrapMaterialDatePicker({
                    time: true,
                    weekStart: 1,
                    format : 'DD/MM/YYYY HH:mm', 
                    lang : 'fr',  
                    cancelText : 'ANNULER'
                });
                $('#date-picker-volume').bootstrapMaterialDatePicker({
                    time: true,
                    weekStart: 1,
                    format : 'DD/MM/YYYY HH:mm', 
                    lang : 'fr',  
                    cancelText : 'ANNULER'
                });
            }
        );
    }
);
})

但是当我尝试不再使用单个日期选择器时,我真的不知道如何摆脱这种情况。

这是html模板之一:

<div class='fields'>
<div class='row mb-3'>
  <div class='col'>
     <label class='mb-1'>Montant</label>
     <div class='input-group'>
        <input class='amount-field text-right form-control' type='text' name='data['Client']['volume']' id='clientvolume' value='".$client['Client']['volume']."'>
        <div class='input-group-prepend input-group-append'><span class='input-group-text'>€</span></div>
     </div>
  </div>
  <div class='col pl-0'>
     <label class='mb-1'>Probabilité</label>
     <div class='input-group'>
        <input class='probability text-right form-control' maxlength='3' size='3' type='text' name='' id=''>
        <div class='input-group-append'><span class='input-group-text'>%</span></div>
     </div>
  </div>
</div>
</div>
<label class='d-block mb-1'><i class='fa-flag-checkered fa'></i>Date de closing estimée</label>
<div class='input-group mb-3' style='background:none'><input type='date' class='form-control' id='date-picker-volume'></div>
</div><input type='submit' name='commit' value='Enregistrer' id='btnValVolume' class='btn btn-outline-success'>
<button type="button" id="btnVolume" class="btn btn-light" data-html="true" data-placement="bottom" data-toggle="popover" data-content="<?php echo $popupvolume ?>"><?php echo $client['Client']['volume']." €"; ?></button>

0 个答案:

没有答案