Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Opera browser from enriching HTML5 fields

I'm using loads of inputs with HTML5 types (such as 'date' or 'time') using the jQuery Tools library. Some browsers (like Opera) automatically recognize that and, for example, transform the <input type="time" /> into a time input.

However, I do not want that behavior (since Opera's time input does not include seconds). Is there any common HTML5 way of disabling such special behavior?

Thanks, Remo

like image 935
Remo Avatar asked Feb 15 '11 13:02

Remo


2 Answers

If you want a time element on Opera to display seconds, add the attribute step="1", you can get milliseconds by setting step="0.1" and step=60 will give you the default hh:mm again. This also works in Chrome (tested in 9.0.597.98 beta).

like image 177
robertc Avatar answered Oct 17 '22 07:10

robertc


As most of the commenters on the original question already stated: No, there is no "common HTML5 way" to prevent this behavior.

Even if so, you shouldn't. You're effectivly asking Opera to ignore something you asked for in the first place: a special UI.

like image 22
Kriem Avatar answered Oct 17 '22 07:10

Kriem