Using with attribute to get intervals of 15 minutes

8 hours ago 1
ARTICLE AD BOX

I am working on a prototype of a photography website HTML and I in the Booking page of my website I want to use a date and time selector. But with the step attribute the browser shows all options instead of what is needed for the 15 minute intervals 00:00, 00:15, 00:30, 00:45. Also I need the minimum time to be 8:00 and max 18:00 using min and max attributes. Even after doing that there are still options for all the other time slots i don't need.

I have come up with this piece of code to fix the issues I have above but I am very unsure in doing it this way, just does not feel right.

<select name="bookingTime" id="bookingTime"> <option value="08:00"></option> <option value="08:15"></option> <option value="08:30"></option> <option value="08:45"></option> <option value="09:00"></option> <option value="09:15"></option> <option value="09:30"></option> <option value="09:45"></option> <option value="10:00"></option> <option value="10:15"></option> <and so on...> </select>

I will have over 50 lines with just options for one dropdown which i read about is not a good practice.
What can I do instead to fix this issue?

Read Entire Article