Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
新增input type 屬性值
類型 使用示例 描述
email <input type="email"> 必須輸入郵箱格式
tel <input type="tel"> 必須輸入手機號碼格式
url <input type="url"> 必須輸入url格式
number <input type="number"> 必須輸入數字格式
search <input type="search"> 必須搜索框(體現語義化)
range <input type="range"> 自由拖動滑塊
time <input type="time"> 小時分鐘
date <input type="date"> 年月日
datetime <input type="datetime"> 時間
month <input type="month"> 月年
week <input type="week"> 星期 年
color <input type='color'> 顏色
新增的input標簽屬性
屬性 用法 含義
placeholder <input type="text" placeholder="請輸入..."> 占位符 當用戶輸入的時候 里面的文字消失 刪除所有文字,自動恢復
autofocus <input type="text" autofocus> 規定當頁面加載時 input 元素應該自動獲得焦點
multiple <input type="file" multiple> 多文件上傳
autocomplete <input type="text" autocomplete="off"> 規定表單是否應該啟用自動完成功能 有2個值,一個是on 一個是off on 代表記錄已經輸入的值 1.autocomplete 首先需要提交按鈕2.這個表單您必須給他名字
required <input type="text" required> 必填項 內容不能為空
這里我們創建一個填寫個人基本信息的表單,使用了表單元素有<input>輸入框、<datalist>選項列表、<textarea>文本框,通用的表單輸入類型有text、password、file、radio、checkbox、email、url、number、Date pickers。并為表單及表單元素設定了相應的屬性。代碼如下:
9 novalidate
novalidate是屬性規定在提交表單時不應該驗證form和input域。novalidate屬性適用于的<input>類型有:text、search、url、telephone、email、password、date pickers、range及color。用法如下:
這段代碼中,我們為表單設置novalidate屬性,使表單不驗證提交,表單中的email和url文本域不必通過驗證。
*請認真填寫需求信息,我們會在24小時內與您取得聯系。