I need to be able to validate certain fields even if they were never touched by the user. Some fields are required, however, at least as I've experienced it so far, a required field is not invalidated on submit: it is only invalidated on blur. So if the user never actually touches a field (or any fields, for that matter), and hits submit, the form will validate successfully and submit, causing server-side validation errors.
My question regarding AngularJS form validation: How do you FORCE the entire form to validate on submission, regardless of whether a user has actually touched any form fields or not?
I have a bunch of forms, and on most forms there are several required fields, as well as fields with min/max and maxlength requirements. If I just build an AngularJS form, apply directives like ng-required, and hit submit, the forms always submit. Nothing stops it.
I need my forms to NOT submit if required fields are empty, regardless of whether the user has actually touched them and left (which is the only way a blur event will fire, and therefor the only way those fields will be validated.)
Using the "disabled" submit button approach is unacceptable for me here.MongoDB Tutorial