I just ran into the following problem:
In a web-app UI I want the user to input a timeframe in hours in which to respond to a message. The timeframe should be up to 72 hours. We’d love to use <input type="time">
but its limited to 24 hours max.
<input type="time">
has an optional max value. I think a default maximum of 24 hours makes sense but it would be handy if the max could get set all the way up to 99:99 hours.
Any suggestions on where I can suggest a change in the standard?
input type="time" The value of the time input type is commonly in 24-hour format ("hh:mm").
Definition and UsageThe max attribute specifies the maximum value (time) for a time field. Tip: Use the max attribute together with the min attribute to create a range of legal values. Tip: To set or return the value of the min attribute, use the min property.
If you want the time with AM & PM, check the first two values, and utilize something like the following: if(FirstTwoNums > 12){ FirstTwoNums -= 12; PM = true;}/*else, PM is false */ .
You can try to use the number
type as:
<input type="number" min="0" max="100">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With