I have two drop downs one for a punch in and one for a punch out. They both are in 24 hour time so they have options from 0-23. Is there a way I can use javascript and php to make the out dropdown start a number greater than the chosen in drop down?
these are chunks of code, dont mind the open and closing of table tags
<td>Start Time</td>
<td>
<select name="hourIn" id="hourIn">
<option value="" selected></option>
<? for ($hour=0; $hour <= 23; $hour++): ?>
<option value="<?=$hour?>"><?=$hour?></option>
<? endfor ; ?>
</select>
<td>End Time</td>
<td>
<select name="hourOut" id="hourOut">
<option value="" selected></option>
<? for ($hour=0; $hour <= 23; $hour++): ?>
<option value="<?=$hour?>"><?=$hour?></option>
<? endfor ; ?>
</select>
Yes, with JavaScript:
You may need to fiddle with the logic for the edge cases, but that’s the gist of it.