HTML5 拥有多个新的表单输入类型(color、date、datetime、datetime-local、email、month、number、range、search、tel、time、url、week 拥有多个可供选取日期和时间的新输入类型: date - 选取日、月、年 month - 选取月、年 week - 选取周和年 time - 选取时间(小时和分钟) datetime - 选取时间、日、月、年(UTC 时间) datetime-local 拥有多个可供选取日期和时间的新输入类型: date - 选取日、月、年 month - 选取月、年 week - 选取周和年 time - 选取时间(小时和分钟) datetime - 选取时间、日、月、年(UTC 时间) datetime-local
6">{{ form.event_starts.label }}
本章全面介绍这些新的输入类型: color date datetime datetime-local email month number range search tel time url week 定义一个日期和时间控制器(本地时间): 生日 (日期和时间): <input type="datetime" name="bdaytime"> Input 类型: datetime-local datetime-local 定义一个日期和时间 (无时区): 生日 (日期和时间): <input type="<em>datetime-local</em>" name="bdaytime"> Input 类型: email email 类型用于应该包含
<label class='lab' for="exampleInputName2">start_time</label> <input type="<em>datetime-local</em> <label class='lab' for="exampleInputEmail2">end_time</label> <input type="<em>datetime-local</em>
="month">
星期:<input type="week" name="week">
本地日期和时间:<input type="<em>datetime-local</em> " name="<em>datetime-local</em>">
</body>
</html>
html 中的保留字符:
24"/> 时间控件 - time <input type="time" value="13:59"/> <input type="time" value="13:59:59"/> 日期时间控件 - datetime-local 日期控件12小时制,可点击下午或上午后输入a或p修改 <input type="<em>datetime-local</em>" value="2015-09-24T13:59:59" 月控件 - month <input
”>上海</option> <option value=”nanjing”>南京</option> </select>
时间:<input type=”datetime-local ” name=”datetime-local”>
选择数字并且可以限定最大值最小值:<input type=”number” name=”num” value=”1″ min value值后-->
<textarea name="feedback" id="" cols="30" rows="10"></textarea>
<input type="<em>datetime-local</em> " name="<em>datetime-local</em>">
<input type="number" name="num" value="1" min="0" max="10">
-> 允许开发者直接在输入框定义正则,验证用户输入是否匹配; color 定义颜色; image 图片按钮:src:定义图片路径; month 定义月份; week 定义周; time 定义时分; datetime-local "image" src="xiaoma.jpg"> <input type="month"> <input type="week"> <input type="time"> <input type="<em>datetime-local</em>
name: "IsPublic",label:"",checked:""}) //生成复选框 f.DateTimeTag({"name": "ExpiresAt", "value": date}) //生成datetime-local var:"f"}) 标签内的参数为绑定模型的结构体的属性 eg: model_name{ ExpiresAt time.Time } f.DateTimeTag("ExpiresAt") // 生成datetime-local
--datetime-local:日期和时间-->
日期时间:<input type="<em>datetime-local</em>">
月份:<input type="month"> <br
datetime-local:本地日期、时间选择器。week:供用户选择第几周的文本框。 ><input name="date" type="date"/>
type="time"的文本框:
<input name="time" type="time"/>
type="datetime-local "的文本框:
<input name="<em>datetime-local</em>"
type="<em>datetime-local</em>"/>
type="month"的文本框:
<input
list | 除了 hidden、password、checkbox、radio 和按钮以外 | 自动完成选项的 的 id 属性的值 |
| max | date、month、week、time、datetime-local password | value 的最大长度(字符数) |
| min | date、month、week、time、datetime-local mobile) |
| date | 日期选择器 (mobile) |
| datetime | 日期时间选择器 (mobile) |
| datetime-local type="week"> 选择周和年
<input type="time"> 选择时间(无时区)
<input type="datetime"> 选择日期和时间(有时区)
<input type="<em>datetime-local</em> time): <input type="datetime" name="bday_time">
Birthday (date and time): <input type="<em>datetime-local</em>
限制用户输入必须为Email类型 type="url" 限制用户输入必须为URL类型 type="date" 限制用户输入必须为日期类型 type="datetime" 显示完整日期 含时区 type="datetime-local 拥有多个可供选取日期和时间的新输入类型: date 选取日、月、年 month 选取月、年 week 选取周和年 time 选取时间(小时和分钟) 以下两个没有作用 datetime 选取时间、日、月、年(UTC 时间) datetime-local
datetime:选取时间、日、月、年(UTC 时间) date:选取日、月、年 month:选取月、年 week:选取周和年 time:选取时间(小时和分钟) datetime-local:选取时间、
button 一样 input type="checkbox" 复选框 input type="color" 颜色选择器 input type="date" 日期,包括年,月和日 input type="datetime-local
type="datetime" name="" id="" /> input:date inp[type=date] <input type="date" name="" id="" /> input:datetime-local inp[type=datetime-local] <input type="<em>datetime-local</em>" name="" id="" /> input:month inp[type=month] <
拥有多个可供选取日期和时间的新输入类型: 1、date 选取日月年 2、month选取月年 3、week 选取周和年 4、time 选取时间(小时和分钟) 5、datetime选取时间、日、月、年(UTC时间) 6、datetime-local
Datetime-local <input type="<em>datetime-local</em>" id="MyDateTimeLElement" name="MyDateTimeLElement" /> MyTimeElement" name="MyTimeElement" /> <label>DateTime Local Demo</label> <input type="<em>datetime-local</em>
主机地址: <input type="text" name="address" placeholder="输入主机IP地址">
开始时间: <input type="<em>datetime-local</em> " name="start_datetime" />
结束时间: <input type="<em>datetime-local</em>" name="end_datetime" />
{{ item }}</option> {% endfor %} </select>开始时间: <input type="<em>datetime-local</em> " name="start_datetime" />
结束时间: <input type="<em>datetime-local</em>" name="end_datetime" /></p
p>主机地址: <input type="text" name="address" placeholder="输入主机IP地址">
开始时间: <input type="<em>datetime-local</em> " name="start_datetime" />
结束时间: <input type="<em>datetime-local</em>" name="end_datetime" /></ ">{{ item }}</option> {% endfor %} </select>
开始时间: <input type="<em>datetime-local</em> " name="start_datetime" />
结束时间: <input type="<em>datetime-local</em>" name="end_datetime" /></