سؤال

I want to get a 'time' input box (that sows the arrows to increase/decrease time). The following code works in chrome/mozilla but it doesnt in internet explorer :

    <label for="moduleStart">Hours from:</label>
    <input type="time" name="moduleStart" class="dateFormat"/>

How can this be fixed?

هل كانت مفيدة؟

المحلول

Many element types are new in HTML5 thus not supported by older browsers. You could use a polyfill for non HTML5 browsers.

In this case one like:

http://dl.dropbox.com/u/598365/html5forms/html5forms.html

The objective is to allow authors to use most HTML5 control types and attributes even in browsers which do not yet support all these new HTML5 features. Some of these features are only implemented in the latest version of Opera and partially in Webkit based browsers. To achieve this we need the ability to recognize and handle correct validation for these new types and be able to set:

نصائح أخرى

Internet explorer does not support this input type.

Use HTML5 Modernizer to support HTML5 new input types in browsers that don't support new inputs

From Docs:

These types can enable native datepickers, colorpickers, URL validation, and so on. If a browser doesn’t support a given type, it will be rendered as a text field. Modernizr cannot detect that date inputs create a datepicker, the color input create a colorpicker, and so on—it will detect that the input values are sanitized based on the spec. In the case of WebKit, we have received confirmation that sanitization will not be added without the UI widgets being in place.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top