input-time-validator

1.0.2 • Public • Published

input-time-validator

A cross-browser polyfill for min and max time validation to <input type="time">elements.

imput time validator

The Problem

Some browsers do not support the input time element, but degrade them to an input text element, which may longer be validated.

This input:

<input type="time" min="09:00" max="16:00">

is converted to this degraded form:

<input type="text" min="09:00" max="16:00">

By converting to type="text", the min/max validation of user input is eliminated.

The Solution

Load this script at the end of the body:

<script src="<path-to>inputTimeVal.js"></script>

which will detect any degraded input time elements and add a validation script to their parent forms.

Readme

Keywords

none

Package Sidebar

Install

npm i input-time-validator

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

3.87 MB

Total Files

7

Last publish

Collaborators

  • terrymorse