https://github.com/thesharpieone/angular-submit-validation
Validates the form on form submission (setting the right classes and properties)
https://github.com/thesharpieone/angular-submit-validation
Last synced: 8 months ago
JSON representation
Validates the form on form submission (setting the right classes and properties)
- Host: GitHub
- URL: https://github.com/thesharpieone/angular-submit-validation
- Owner: TheSharpieOne
- Created: 2013-12-13T18:32:11.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-05-23T17:50:01.000Z (about 10 years ago)
- Last Synced: 2025-02-01T08:24:57.390Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
angular-submit-validation
=======================
Validates the form on form submission. It will set the classes and properties that would normally be set when a field is validated by angular.
Usage:
------
This directive based on the normal HTML `````` element. The form needs a `name` attribute. Just make sure the directive is loaded and it will attach to all ``````s.
```html
```
```novalidate``` will disable the browser’s native validation, you probably don't want the native validation to happen.
Note:
This does prevent the submission of the form if it is invalid! You can use the `allowInvalidSubmission` attribute to allow the submission of (triggering of `ngSubmit` with invalid values). If `ngSubmit` returns a promise, the form will not be allowed to submit again until the promise is resolved/rejected (works great if you return a call to `$http` for ajax submissions). The `$submitting` proprty on the form (would be `myForm.$submitting` in the example above) will be true while the promise is pending, which is useful for showing a loading indicator.
This will trigger the validation of all of the inputs in all of the [nested] forms (use `ngForm` to nest for browser compatibility).