-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation does not work. #31
Comments
I had the same problem. try adding name="files" to the directive. like this. <form name="testForm">
<lf-ng-md-file-input name="files" lf-maxcount="10" lf-filesize="1MB"></lf-ng-md-file-input> the <div ng-messages="testForm.files.$error" style="color:red;"> testForm is the name of the form |
I tried this, but it does not work.
|
<form name="testForm" layout="column" ng-submit="onSubmit()">
<lf-ng-md-file-input name="files" lf-files="files05" lf-browse-label="Search" lf-remove-label="Delete" lf-drag-and-drop-label="Drag and Drop here!" lf-maxcount="1" lf-filesize="1MB" lf-totalsize="5MB" drag preview progress multiple type="file" fileread="" accept=".xls,.xlsx,.ods" multiple="false"></lf-ng-md-file-input>
<div ng-messages="testForm.files.$error" style="color:red;">
<div ng-message="maxcount">Too many files.</div>
<div ng-message="filesize">File size too large.</div>
<div ng-message="totalsize">Total size too large.</div>
<div ng-message="mimetype">Mimetype error.</div>
</div>
<md-button class="md-raised md-button md-ink-ripple md-accent" type="submit" ng-disabled="testForm.$invalid">Submit</md-button>
</form> make sure your form has a name to. and add the angular-messages module to your app. <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.1/angular-messages.js"></script> app.js angular.module('myApp', [
"lfNgMdFileInput",
"ngMessages"
]) |
The upload does not update $dirty or $pristine or $touched fields for element. This way you're forced to show errros all the time on page, not only on submit or change. |
Any update on the set $pristine thing????? |
Validation API does not function.
The text was updated successfully, but these errors were encountered: