鍍金池/ 問答/網(wǎng)絡安全  HTML/ bootstrap同一行有兩個輸入框驗證,一個個驗證通過卻顯示紅色

bootstrap同一行有兩個輸入框驗證,一個個驗證通過卻顯示紅色

第一個輸入框校驗通過了,卻顯示紅色,這是為什么,只有當?shù)诙€也驗證通過的時候兩個才會都變綠,是因為這兩個輸入框都在一個form-group里面嗎
<div class="form-group">

                    <label class="col-lg-2 control-label">電話</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="reporttel" id="reporttel"/>
                    </div>
                    <label class="col-lg-2 control-label">E_mail</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="reportemail" id="reportemail"/>
                    </div>
                </div>

圖片描述

問題出現(xiàn)的環(huán)境背景及自己嘗試過哪些方法

相關代碼

// 請把代碼文本粘貼到下方(請勿用圖片代替代碼)

你期待的結(jié)果是什么?實際看到的錯誤信息又是什么?

回答
編輯回答
生性

錯誤驗證,form-group 內(nèi)包裹input ,應該分出, 添加錯誤樣式的方法 input上層父元素添加類似于.is-error樣式,因為這兩個輸入框都在一個form-group里面所以倆個都應用了驗證錯誤的樣式

2017年12月13日 05:56