maaartinus
maaartinus

Reputation: 46392

How to get rid of HTML validation or remove red borders on invalid/required elements

I am trying to get rid of HTML validation completely. This question would help if I had all inputs inside some forms. But I don't, as with angularjs I only need a form if I want to know if all fields in some set are valid. Moreover, HTML form elements don't stack, so I'm using ng-form only.

I actually don't care if the form gets validated or not; I only want to get rid of the red border in Firefox just like in this question. Is there a way how to style the glowing red to zero size or transparency or whatever? In Firefox I can't see it.

Alternatively, is there a possibility to teach angularjs work with some other attribute name rather than required, so that HTML5 doesn't jump in to visually destroy my page?

Upvotes: 0

Views: 883

Answers (2)

TylerH
TylerH

Reputation: 21098

Migrating OP's solution from the question to an answer:

Actually, there's a simpler possibility: As I'm using no HTML forms at all and I need some top-level container anyway, it can be a <form novalidate> instead of a <div>. Too simple to be seen.

Upvotes: 0

putvande
putvande

Reputation: 15213

You can use :

:invalid {
    box-shadow: none;
}

:invalid

Upvotes: 2

Related Questions