2015-01-13 44 views
0

來的時候已經follwing HTML爲什麼紅色邊框默認情況下,在形式

<form ng-submit="submitForm()" method="POST"> 
    <div class="formRow"><input type="email" placeholder="Email" ng-model="form.emailId" name="email" required></div> 
    <button type="submit" ngclick="Submit">Signin</button> 

它顯示默認籃板邊界。爲什麼?

當我在Firefox檢查HTML我得到這個

<input type="email" required="" name="email" ng-model="form.emailId" placeholder="Email" class="ng-pristine ng-invalid ng-invalid-required ng-valid-email"> 

什麼想法?

謝謝

+0

有什麼明顯改變JS內的輸出可能嗎? – Lee

+0

其聲稱表單輸入的嫌疑人無效。這是否發生在頁面加載?你有沒有任何能夠激發公司驗證的代碼? – atmd

+0

它正在頁面加載中發生。 –

回答

1

這可能是這是瀏覽器突出顯示。在HTML5中,我們有表單輸入驗證,並且您的輸入的類型爲email。這就是爲什麼如果內容不匹配email字段的要求可能會出現紅色邊框。

爲了防止這個集合novalidate屬性的形式。

<form novalidate action="/some/action" method="POST"></form> 

希望能有所幫助。

novalidate在W3C上。

+0

驗證呢? –

+0

在這種情況下,空驗證將消失 –

+0

它不會消失,它仍將被驗證,但不會發生瀏覽器特定操作。我的意思是沒有特定的裝飾 – devdRew

相關問題