2017-02-12 55 views
1

我有這樣一種形式:http://jsfiddle.net/bppe3nsb/Overwritting引導形式驗證。先後錯誤Firefox和邊緣

當我們點擊發送按鈕,我不想未填寫現場的任何變化。沒有紅色邊框。沒有影子。彈出信息是不夠的:

enter image description here

瀏覽器工作正常,我沒有任何紅色邊框,但邊緣和Firefox顯示大紅色邊框這樣點擊發送按鈕後,如果需要的所有字段沒有填寫:

enter image description here

於是,我就重寫。先後錯誤類這樣的,但沒有成功:

.has-error input[type=text], 
.has-error input[type=email], 
.has-error textarea { 
    border: 1px solid rgba(0,0,0,.1); 
} 

爲什麼它不起作用?我看到的所有例子都在談到.has-error

對於Firefox的解決方案不適用於Edge http://jsfiddle.net/jd46q3vg/

input:required { 
    box-shadow:none; 
} 
input:invalid { 
    box-shadow:none; 
} 
textarea:required { 
    box-shadow:none; 
} 
textarea:invalid { 
    box-shadow:none; 
} 
+0

紅色邊框無關與引導。火狐添加它們只是因爲該字段是「必需的」。 (您可以通過完全刪除bootstrap來檢查這是否爲真;您將看到仍然出現紅色邊框)。見[這裏](http://stackoverflow.com/questions/5939341/firefox-4-is-there-a-way-to-remove-the-red-border-in-a- required_form- input)和[這裏](http://stackoverflow.com/questions/3809146/firefox-4-required-input-form-red-border-outline?noredirect=1&lq=1)。 – abl

+0

[Firefox 4需要的輸入形式RED border/outline]可能的重複(http://stackoverflow.com/questions/3809146/firefox-4-required-input-form-red-border-outline) – abl

+0

是的,但不工作與邊緣。如何爲Edge刪除它? http://jsfiddle.net/jd46q3vg/ –

回答

1

請提供

的box-shadow:無; 概要:無;

該輸入框將解決IE/EDGE的問題/ Firefox的

+0

是的,我做到了。 http://jsfiddle.net/jd46q3vg/適用於Firefox,但不適用於Edge。任何想法如何從邊緣刪除它呢?謝謝。 –

+1

簡單給大綱:無;也會在IE/Edge中解決問題 –