I have this problem where I have to set multple jQuery timepicker's default value (they are put in an HTML table) from the PHP array which is looped.
Here's the JS code for one timepicker textbox:
$(document).ready(function(){
$('.timepicker').timepicker({
timeFormat: 'HH:mm',
interval: 1,
minTime: '7',
maxTime: '7:00pm',
defaultTime: '<?php echo $records[$i]->time_in ?>',
dynamic: false,
dropdown: true,
scrollbar: true
});
});
</script>
and the table is populated thru a loop:
<table border=1>
<tr>
<th>Time In</th>
<tr>
@for($i=0;$i<count($records);$i++)
<tr>
<td><input type="text" class="timepicker" id=start_shift_$i /></td>
</tr>
@endfor
</table>
What I'm trying to do is to populate the timepickers default value with the time_in values looped from an array.
Hope you can help. Thanks!