Closed philipkueng closed 9 years ago
What do you want to achieve with that? Only show the border only after (unsuccessful due to invalid form-fields?) submission?
Exactly. In your example you only show the red border when you leave the inputbox. I want to show the red border when the input is invalid
Well, there is unfortunately no class added for that yet. But you could do it like this:
<form name="blaForm"
ng-class="{'your-parent-form-tried-submit-class': blaForm.$triedSubmit}>
</form>
And then do something like
.your-parent-form-tried-submit-class input.ng-invalid{
border: 1px solid red;
// or whatever your error styles should be for inputs
}
I think this feature is not too imortant. If someone really needs it, feel free to reopen.
Is there a way to set the border of a inputbox after I hit the submit button? Your example just handles the leave- and enter events