jquery - Multiple Bootstrap datepickers in one page -
i have little problem boostrap datepickers.
$('#date1,#date2,#date3,#date4,#date5,#date6').datetimepicker({ language: 'es', weekstart: 1, todaybtn: 1, autoclose: 1, todayhighlight: 1, startview: 2, minview: 2, forceparse: 0 });
the problem date2 date6 created jquery when users clicks buttom , datetimepicker not working, date1.how can solve this? thanks
adding answer clarify class comment. use class on newly added elements, create datepicker attaching body or document such as:
<div class='input-group date datepicker-me-class' id='date2'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div>
now attach document:
$(document).on('focus', ".datepicker-me-class", function() { $(this).datepicker({ language: 'es', weekstart: 1, todaybtn: true, autoclose: true, todayhighlight: true, startview: 2, minviewmode: 2, forceparse: false }); });
Comments
Post a Comment