Amal Amal - 1 month ago 8x
HTML Question

html input type time validation between given number of hours

<tr><td height="50"><br><div class=headingbox>Expected Time</div>
<input class="textfill" type=time name=DPTime required autofocus onfocusout="upperCASE(this)" id=time name=time min="0800" max="1600" ></div></td></tr>

I am developing a web app for a shop. I want to validate input such that on-line orders can be placed only during the hours the shop is open (i.e between 8am and 4pm).

If the shop is closed, I want to return an error message in an alert box.

How can I do this?


Try this. You can always compare the strings of date if they are in HH:mm:ss format