筆記 - HTML5網頁設計初窺(3)-智能表單設計
表單類型歷史1995年html2開始提出
form式設計,服務器與客戶端進行交互
html 服務器與客戶端進行交互的方式:put get post delete
交互性的基礎
使用javascript把進行表單控制,判斷用戶數據輸入的合法性
html5使用了基本類型的表單限定,date,color,range
配合用戶輸入提供了新的數據類型
number
range
Date pickers(date,month,week,time,datetime,datetime-local)
search
color
Input TYpe -- email
E-mail:<imput type="email" name="user_email" />:
Input Type -- url
URL:<input type="url" name="url" />
Input Type - number
points:<input type="number" name="points" min="1" max="10" />
step 步進修改值
value 初始值
input type - range
<input type="range" name="points" min="1" max="10" />
step 步進修改值
value 初始值
input type - date pickers
以前使用js的日歷控件實現該功能,在HTML5中可使用獨立控件
date - Selects date,month and year
month - Selects month and year
week - Selects week and year
time - Selects time(hour and minute)
datetime -Selects time, date, month and year(UTC time) and year(loal time)
Forms的新屬性
Autofocus
<input type=search name=query autofocus>
Placeholder
<input type=email name=email id=email placehlder="user@host.com">
Required