我有一个带有循环的表格,我想使用一个时间选择器。问题出在循环外它工作正常,但在循环内它不起作用。For the 3 input box it's possible to see the time picker but when select the time it will change only the first box.
<?php for ($i = 1; $i <= 3; $i++) { ?>
Time <input type='text' name='timepicker[<?= $i ?>]' class="datepicker_dynamic" id='timepicker[<?= $i ?>]' value=''/>
<?php } ?>
<script type='text/javascript'>
$(document).ready(function() {
$('.datepicker_dynamic').timepicker({
showLeadingZero: false,
});
});
</script>