I have 3 fields, day, start time and end time.
I want to validate that the time is between 09:00 and 12:00 for the start time and 13:00 - 18:00 for the end time, the problem is that I need to validate with HH:MM:SS format and is an INPUT text.
<div>
<select class="dia sel tf w-select" data-name="Selecciona Una Opcion 2" id="txtTipoPropiedad" name="txtTipoPropiedad">
<option value="0" selected>Día</option>
<% for (int i = 0; i < dia.length; i++) {
out.println("<option value=\"1\">" + dia[i] + "</option>");
}
%>
</select>
<input class="porc right tf w-input" id="node_i" maxlength="256" name="h_ini" placeholder="09:00 - 12:00 hrs" required="required" type="text">
<input class="porc right tf w-input" id="node_f" maxlength="256" name="h_fin" placeholder="13 - 18:00 hrs" required="required" type="text">
</div>
You just need to use the methods:
Each will give you the hours, minutes and seconds independently and you can then concatenate them to a string like this:
Then later, you can limit it to the time, in case you need more specific tasks, for example: