最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Bootstrap中表單控件狀態(tài)(驗(yàn)證狀態(tài))

 更新時(shí)間:2016年08月04日 14:28:02   作者:詩(shī)閔  
這篇文章主要介紹了Bootstrap中表單控件狀態(tài)(驗(yàn)證狀態(tài)) 的相關(guān)資料,還給大家介紹了在Bootstrap框架中提供的機(jī)制驗(yàn)證效果,非常不錯(cuò),需要的朋友可以參考下

在制作表單時(shí),難免要做表單驗(yàn)證。同樣也需要提供驗(yàn)證狀態(tài)樣式,在Bootstrap框架中同樣提供這幾種效果。

1、.has-warning:警告狀態(tài)(黃色)

2、.has-error:錯(cuò)誤狀態(tài)(紅色)

3、.has-success:成功狀態(tài)(綠色)

使用的時(shí)候只需要在form-group容器上對(duì)應(yīng)添加狀態(tài)類名。

<form role="form">
<div class="form-group has-success">
<label class="control-label" for="inputSuccess1">成功狀態(tài)</label>
<input type="text" class="form-control" id="inputSuccess1" placeholder="成功狀態(tài)" >
</div>
<div class="form-group has-warning">
<label class="control-label" for="inputWarning1">警告狀態(tài)</label>
<input type="text" class="form-control" id="inputWarning1" placeholder="警告狀態(tài)">
</div>
<div class="form-group has-error">
<label class="control-label" for="inputError1">錯(cuò)誤狀態(tài)</label>
<input type="text" class="form-control" id="inputError1" placeholder="錯(cuò)誤狀態(tài)">
</div>
</form> 

運(yùn)行效果如下或查看右側(cè)結(jié)果窗口:

很多時(shí)候,在表單驗(yàn)證的時(shí)候,不同的狀態(tài)會(huì)提供不同的icon,比如成功是一個(gè)對(duì)號(hào)(√),錯(cuò)誤是一個(gè)叉號(hào)(×)等。在Bootstrap框中也提供了這樣的效果。如果你想讓表單在對(duì)應(yīng)的狀態(tài)下顯示icon出來(lái),只需要在對(duì)應(yīng)的狀態(tài)下添加類名“has-feedback”。請(qǐng)注意,此類名要與“has-error”、“has-warning”和“has-success”在一起:

<form role="form">
<div class="form-group has-success has-feedback">
<label class="control-label" for="inputSuccess1">成功狀態(tài)</label>
<input type="text" class="form-control" id="inputSuccess1" placeholder="成功狀態(tài)" >
<span class="glyphicon glyphicon-ok form-control-feedback"></span>
</div>
<div class="form-group has-warning has-feedback">
<label class="control-label" for="inputWarning1">警告狀態(tài)</label>
<input type="text" class="form-control" id="inputWarning1" placeholder="警告狀態(tài)">
<span class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
</div>
<div class="form-group has-error has-feedback">
<label class="control-label" for="inputError1">錯(cuò)誤狀態(tài)</label>
<input type="text" class="form-control" id="inputError1" placeholder="錯(cuò)誤狀態(tài)">
<span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div>
</form> 

運(yùn)行效果如下或查看右側(cè)結(jié)果窗口:

從效果圖中可以看出,圖標(biāo)都居右。在Bootstrap的小圖標(biāo)都是使用@font-face來(lái)制作(后面的內(nèi)容中將會(huì)著重用一節(jié)內(nèi)容來(lái)介紹)。而且必須在表單中添加了一個(gè)span元素:

<span class="glyphicon glyphicon-warning-sign form-control-feedback"></span>

以上所述是小編給大家介紹的Bootstrap中表單控件狀態(tài)(驗(yàn)證狀態(tài)) ,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

六盘水市| 南雄市| 弥勒县| 林周县| 铅山县| 绵阳市| 昌宁县| 南澳县| 晋江市| 农安县| 波密县| 大新县| 石狮市| 泾阳县| 云梦县| 洛南县| 寿宁县| 思南县| 洞头县| 湖南省| 出国| 桂阳县| 阿拉尔市| 巴彦县| 铁力市| 界首市| 昌乐县| 徐州市| 襄垣县| 乡宁县| 都匀市| 凌海市| 云阳县| 高邮市| 即墨市| 陵水| 烟台市| 伊宁市| 肥西县| 岗巴县| 福建省|