国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

HTML新的表單屬性

HTML新的表單屬性

HTML5 的<form> 和<input>標(biāo)籤新增了幾個(gè)新屬性.

<form>新屬性:

autocomplete

novalidate

<input>新屬性:

autocomplete

autofocus

form

# formaction

formenctype

formmethod

formnovalidate

formtarget

##height and width

# #min and max

multiple

pattern (regexp)

#placeholder

required

step

#<form> / <input> autocomplete 屬性

autocomplete 屬性規(guī)定form 或input 網(wǎng)域應(yīng)該要有自動(dòng)完成功能。

當(dāng)使用者在自動(dòng)完成網(wǎng)域中開(kāi)始輸入時(shí),瀏覽器應(yīng)該會(huì)在該網(wǎng)域中顯示填寫(xiě)的選項(xiàng)。

提示:?autocomplete 屬性有可能在 form元素中是開(kāi)啟的,而在input元素中是關(guān)閉的。

注意:?autocomplete 適用於 <form> 標(biāo)籤,以及以下類(lèi)型的 <input> 標(biāo)籤:text, search, url, telephone, email, password, datepickers, range 以及 color。

<form> novalidate 屬性

novalidate 屬性的一個(gè)boolean 屬性.

novalidate 屬性規(guī)定在提交表單時(shí)不應(yīng)該驗(yàn)證form 或input 網(wǎng)域。

<input> autofocus 屬性

autofocus 屬性是一個(gè)boolean 屬性.

#autofocus 屬性規(guī)定在頁(yè)面載入時(shí),域自動(dòng)地獲得焦點(diǎn)。

<input> form 屬性

#form 屬性規(guī)定輸入網(wǎng)域所屬的一個(gè)或多個(gè)表單。

提示:如需引用一個(gè)以上的表單,請(qǐng)使用空格分隔的清單。

<input> formaction 屬性

#The formaction 屬性用於描述表單提交的URL位址.

#The formaction屬性會(huì)覆寫(xiě)<form> 元素中的action屬性.

#注意:?The formaction 屬性用於type="submit" 和type="image".

<input> formenctype 屬性

formenctype 屬性描述了表單提交到伺服器的資料編碼(只對(duì)form表單中method="post" 表單)

formenctype 屬性覆寫(xiě)form 元素的enctype 屬性。

主要:?該屬性與 type="submit" 和 type="image" 配合使用。

<input> formmethod 屬性

#formmethod 屬性定義了表單提交的方式。

formmethod 屬性覆寫(xiě)了 <form> 元素的的method 屬性。

注意:?該屬性可以與 type="submit" 和 type="image" 配合使用。

<input> formnovalidate 屬性

novalidate 屬性是一個(gè)boolean 屬性.

novalidate屬性描述了<input> ; 元素在表單提交時(shí)無(wú)需被驗(yàn)證。

formnovalidate 屬性會(huì)覆寫(xiě) <form> 元素的novalidate屬性.

注意:?formnovalidate 屬性與type="submit一起使用

<input> formtarget 屬性

#formtarget 屬性指定一個(gè)名稱(chēng)或關(guān)鍵字來(lái)指明表單提交資料接收後的展示。

The formtarget 屬性覆寫(xiě)<form>元素的target屬性.

注意:?formtarget 屬性與type="submit" 和type="image"配合使用.

<input> height 和width 屬性

#height 和width 屬性規(guī)定用於image 類(lèi)型的<input> 標(biāo)籤的圖片高度和寬度。

注意:?height 和 width 屬性只適用於 image 類(lèi)型的<input> 標(biāo)籤。

提示:圖像通常會(huì)同時(shí)指定高度和寬度屬性。如果圖像設(shè)定高度和寬度,圖像所需的空間 在載入頁(yè)時(shí)會(huì)被保留。如果沒(méi)有這些屬性, 瀏覽器不知道圖像的大小,並不能預(yù)留 適當(dāng)?shù)目臻g。圖片在載入過(guò)程中會(huì)使頁(yè)面佈局效果改變 (儘管圖片已載入)。

<input> list 屬性

#list 屬性規(guī)定輸入域的 datalist。 datalist 是輸入域的選項(xiàng)清單。

<input> min 和max 屬性

#min、max 和step 屬性用於為包含數(shù)字或日期的input 類(lèi)型規(guī)定限定(約束)。

注意:?min、max 和 step 屬性適用於下列類(lèi)型的 <input> 標(biāo)籤:date pickers、number 以及 range。

<input> multiple 屬性

multiple 屬性是一個(gè)boolean 屬性.

multiple 屬性規(guī)定<input> 元素中可選擇多個(gè)值。

注意:?multiple 屬性適用於下列類(lèi)型的 <input> 標(biāo)籤:email 和 file。 : email, and file.

<input> pattern 屬性

pattern 屬性描述了一個(gè)正規(guī)表示式用於驗(yàn)證<input> ; 元素的值。

注意:pattern 屬性適用於以下類(lèi)型的<input> 標(biāo)籤: text, search, url, tel, email, 和password.

提示:?是用來(lái)全域?title?屬性描述了模式.

<input> placeholder 屬性

placeholder 屬性提供一個(gè)提示(hint),描述輸入域所預(yù)期的值。

簡(jiǎn)短的提示在使用者輸入值前會(huì)顯示在輸入域上。

注意:?placeholder 屬性適用於下列類(lèi)型的 <input> 標(biāo)籤:text, search, url, telephone, email 以及 password。

<input> required 屬性

required 屬性是一個(gè)boolean 屬性.

required 屬性規(guī)定必須在提交之前填寫(xiě)輸入域(不能為空)。

注意:required 屬性適用於以下類(lèi)型的 <input> 標(biāo)籤:text, search, url, telephone, email, password, date pickers, number, checkbox, radio 以及 file。

<input> step 屬性

#step 屬性為輸入域規(guī)定合法的數(shù)字間隔。

如果step="3",則合法的數(shù)是-3,0,3,6 等

提示:?step 屬性可以與max 和min 屬性建立一個(gè)區(qū)域值.

注意:?step 屬性與以下type類(lèi)型一起使用: number, range, date, datetime, datetime-local, month, time 和week.


#在下面的案例中,我們對(duì)一些常用的屬性做了解釋?zhuān)蠹抑苯涌闯淌酱a和程式碼旁邊的註釋?zhuān)会釋?duì)照瀏覽器的運(yùn)行結(jié)果就理解其意義了

<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> </head>

<body>
<!--
placeholder:用于在文本框未輸入時(shí)提示作用
autofocus:用于控件自動(dòng)獲取焦點(diǎn)
-->
<input type="search" name="key" value="" results="s" placeholder="君樂(lè)寶" autofocus="true">
<input type="button" name="" value="搜索">
<!--
novalidate:在控件中加入了required、emial、url等驗(yàn)證后,如果想讓這些驗(yàn)證失效,可以在表單中將novalidate設(shè)置為tyue
-->
<form action="upload.php" method="post" accept-charset="utf-8" id="form1" novalidate="true">
<br/><br/>
    <!--
required:必填
autocomplete:在網(wǎng)頁(yè)的文本框中輸入部分內(nèi)容或者雙節(jié)時(shí),經(jīng)常會(huì)看到在下面顯示輸入過(guò)的內(nèi)容,
這就是html5的新特性:自動(dòng)完成,如果不想使用此功能,將其設(shè)置為off即可
-->
    <input type="text" name="UserName" value="" required autocomplete="off">
   <br/><br/>
    <!--
multiple:在選擇文件時(shí),默認(rèn)只能單選,加上這個(gè)屬性后,則可以使用鼠標(biāo)選中多個(gè)文件進(jìn)行上傳
   -->
    選擇文件
    <input type="file" name="upload" value="" multiple="multiple">
    <br/><br/>
    <!--
list:這個(gè)屬性要和datalist元素一起使用,指定此文本框的可選擇項(xiàng),另外其相較于select的優(yōu)點(diǎn)在于還可以輸入
   -->
    區(qū)號(hào):
    <input type="text" name="age" value="" list="list1">
    <br/><br/>
    <datalist id="list1">
        <option value="0312">保定</option>
        <option value="0311">石家莊</option>
        <option value="010">北京</option>
        <option value="0313">唐山</option>
    </datalist>
<br/><br/>
    <!--
formaction:可以更改點(diǎn)擊此按鈕式提交到服務(wù)器的處理程序
formmethod:可以更改向服務(wù)器提交數(shù)據(jù)的方式
   -->
    <input type="submit" name="subsave" value="提交"><br/><br/>
    <input type="submit" name="subresset" value="更改" formaction="1.php" formmethod="get">
</form>
</body>
</html>


繼續(xù)學(xué)習(xí)
||
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> </head> <body> <!-- placeholder:用于在文本框未輸入時(shí)提示作用 autofocus:用于控件自動(dòng)獲取焦點(diǎn) --> <input type="search" name="key" value="" results="s" placeholder="君樂(lè)寶" autofocus="true"> <input type="button" name="" value="搜索"> <!-- novalidate:在控件中加入了required、emial、url等驗(yàn)證后,如果想讓這些驗(yàn)證失效,可以在表單中將novalidate設(shè)置為tyue --> <form action="upload.php" method="post" accept-charset="utf-8" id="form1" novalidate="true"> <br/><br/> <!-- required:必填 autocomplete:在網(wǎng)頁(yè)的文本框中輸入部分內(nèi)容或者雙節(jié)時(shí),經(jīng)常會(huì)看到在下面顯示輸入過(guò)的內(nèi)容, 這就是html5的新特性:自動(dòng)完成,如果不想使用此功能,將其設(shè)置為off即可 --> <input type="text" name="UserName" value="" required autocomplete="off"> <br/><br/> <!-- multiple:在選擇文件時(shí),默認(rèn)只能單選,加上這個(gè)屬性后,則可以使用鼠標(biāo)選中多個(gè)文件進(jìn)行上傳 --> 選擇文件 <input type="file" name="upload" value="" multiple="multiple"> <br/><br/> <!-- list:這個(gè)屬性要和datalist元素一起使用,指定此文本框的可選擇項(xiàng),另外其相較于select的優(yōu)點(diǎn)在于還可以輸入 --> 區(qū)號(hào): <input type="text" name="age" value="" list="list1"> <br/><br/> <datalist id="list1"> <option value="0312">保定</option> <option value="0311">石家莊</option> <option value="010">北京</option> <option value="0313">唐山</option> </datalist> <br/><br/> <!-- formaction:可以更改點(diǎn)擊此按鈕式提交到服務(wù)器的處理程序 formmethod:可以更改向服務(wù)器提交數(shù)據(jù)的方式 --> <input type="submit" name="subsave" value="提交"><br/><br/> <input type="submit" name="subresset" value="更改" formaction="1.php" formmethod="get"> </form> </body> </html>
提交重置程式碼