html5输入类型号码最大限制

时间:2013-02-06 06:33:55

标签: html5

我对html5输入号码有疑问,  输入类型编号的最大限制是什么

表示例如。  

如果在点击微调器后max超过15或17,则显示(数字末尾+16)。

第二个查询是html5 for ios5的datepicker的事件。

由于

1 个答案:

答案 0 :(得分:0)

我不知道您尝试了什么,但没有为max属性指定限制,它可以是任何floating-point number

**Floating-point Number**
A floating-point number consists of the following parts, in exactly the following order:

    Optionally, the first character may be a "-" character.
    One or more characters in the range "0—9".
    Optionally, the following parts, in exactly the following order:
        a "." character
        one or more characters in the range "0—9"
    Optionally, the following parts, in exactly the following order:
        a "e" character or "E" character
        optionally, a "-" character or "+" character
        One or more characters in the range "0—9".

了解更多信息。 http://www.w3.org/TR/html-markup/input.number.html

您可以从How can I limit possible inputs in a HTML5 "number" element?

找到答案

对于在线测试,请使用此网站http://www.w3schools.com/html/html5_form_input_types.asp

对于datetime,您可以参考http://tjvantoll.com/2012/06/30/creating-a-native-html5-datepicker-with-a-fallback-to-jquery-ui/