Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting rid of default red border for required fields

I have some required fields in the form. For required fields I want 1px red border for highlighting form fields after form submit. Chrome is doing that perfectly. IE is giving troubles with default and broad borders. How to get rid of those?

HTML source code:

<div class="tableRow">
    <div class="tableCell fieldCaption borderBottom normalFontWeight">{{'_PHONE_'|i18n}}<span class="mandetory">*</span></div>
    <div class="tableCell fieldValue borderBottom">
        <input type="text" name="phoneValueInput" ng-class="{submitted:createCallBackForm.phoneValueInput.$invalid}" ng-model="taskDto.ContactPhoneNumber" placeholder="{{'_PHONE_NUMBER_'|i18n}}" required  validation-message="{{'_MSG_EMPTY_PHONE_NUMBER_'|i18n}}"/>
    </div>
</div>

CSS:

input.submitted.ng-invalid {
    border: red 1px solid;
}

Code served to IE 11:

<div class="tableRow">
    <div class="tableCell fieldCaption borderBottom normalFontWeight ng-binding">Telefoon<span class="mandetory">*</span></div>
    <div class="tableCell fieldValue borderBottom">
        <input name="phoneValueInput" class="ng-isolate-scope ng-invalid ng-invalid-required ng-dirty" style="margin-left: 10px;" required="" type="text" placeholder="Telefoonnummer" ng-model="taskDto.ContactPhoneNumber" ng-class="{submitted:createCallBackForm.phoneValueInput.$invalid}" validation-message="Telefoonnummer kan niet leeg zijn">
    </div>
</div>

enter image description here

Code served to Chrome (Version 35.0.1916.114 m):

<div class="tableRow">
    <div class="tableCell fieldCaption borderBottom normalFontWeight ng-binding">Phone<span class="mandetory">*</span></div>
    <div class="tableCell fieldValue borderBottom">
        <input type="text" name="phoneValueInput" ng-class="{submitted:createCallBackForm.phoneValueInput.$invalid}" ng-model="taskDto.ContactPhoneNumber" placeholder="Phone Number" required="" validation-message="Phone number can not be empty" class="ng-isolate-scope ng-pristine ng-invalid ng-invalid-required">
    </div>
</div>

enter image description here

Similar kind of scenario can be seen here: http://jsfiddle.net/trixta/qTV3g/

like image 970
Ajinkya Avatar asked Jun 04 '14 12:06

Ajinkya


1 Answers

This ugly appearance in IE is caused by the outline property. You can remove it with this:

input:required:invalid {
    outline: none;
}
like image 148
Renan Barreiro Avatar answered Oct 25 '22 11:10

Renan Barreiro