From version 1.3.0 this can easily be done with $touched
, which is true after the user has left the field.
<p ng-show="form.field.$touched && form.field.$invalid">Error</p>
https://docs.angularjs.org/api/ng/type/ngModel.NgModelController
More Related Contents:
- How can I conditionally require form inputs with AngularJS?
- Disable submit button when form invalid with AngularJS
- What characters are allowed in an email address?
- How to use in JSF page? Single form? Multiple forms? Nested forms?
- Is it a good practice to use an empty URL for a HTML form’s action attribute? (action=””)
- How can I retain HTML form field values in JSP after submitting form to Servlet?
- Preventing form resubmission
- Adding causes java.lang.IllegalStateException: Cannot create a session after the response has been committed
- Submit form on pressing Enter with AngularJS
- Is action really required on forms?
- Multiple forms in a single page using flask and WTForms
- Angular2 – Radio Button Binding
- AngularJS does not send hidden field value
- How to write “Html.BeginForm” in Razor
- Nodejs POST request multipart/form-data
- Better Honeypot Implementation (Form Anti-Spam)
- How do you style the HTML5 form validation messages?
- Clear JSF form input values after submitting
- Manually Set Value for FormBuilder Control
- Angular 2: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- Angular: composite ControlValueAccessor to implement nested form
- How to make ‘submit’ button disabled?
- Required attribute Not working with File input in Angular Js
- HTML5: Slider with two inputs possible?
- HTML slider with two inputs possible?
- How to open a new window on form submit
- Angular form validation ng-disabled not working
- Firefox keeps form data on reload
- Symfony2 invalid form without errors
- Dynamic row height in a SwiftUI form