bootstrap-datepicker icon indicating copy to clipboard operation
bootstrap-datepicker copied to clipboard

datepicker deleting other inputs fields values when i click on it.

Open sizco29 opened this issue 6 years ago • 3 comments

Im working with bootstrap-datepicker i have 2 datepicker in 2 different modals , son in one modal i create a user and in the other modal it updates the user information , in the second modal whenever i click on the datepicker input fields it delete the other inputs value i dont know why.

im using version 1.7.1 any ideas in how to fix it??

sizco29 avatar Aug 30 '17 07:08 sizco29

problem: $('#modify').on('show.bs.modal', function(event){ $('#modify-time').datetimepicker({ format: 'yyyy-mm-dd', minView: 'month', initialDate: new Date(), autoclose: true, todayBtn: true, }) var button = $(event.relatedTarget) var id = button.data('id') var modal = $(this) modal.find('#modify-id').val(id) }) resolve: $('#modify').on('show.bs.modal', function(event){ $('#modify-period-time').datetimepicker({ format: 'yyyy-mm-dd', minView: 'month', initialDate: new Date(), autoclose: true, todayBtn: true, }) if (event.namespace === 'bs.modal') { var button = $(event.relatedTarget) var id = button.data('id') var modal = $(this) modal.find('#modify-id').val(id) } })

longxiang090 avatar Dec 23 '17 06:12 longxiang090

I'm also an problem this, please help me ..

tuananhzippy avatar Aug 09 '18 07:08 tuananhzippy

This should do the trick.

     $('.date_picker').datepicker({
            autoclose: true,
            todayHighlight: true,
        }).on('show.bs.modal', function(event) {
            event.stopPropagation();
      });

Replace .date_picker with your input selector.

MusheAbdulHakim avatar Aug 19 '22 21:08 MusheAbdulHakim