-
Notifications
You must be signed in to change notification settings - Fork 58
Auto validate when control binding ng-disable #53
Comments
Your question is a bit short and possibly missing some details, but having an input that is not disabled and is required is perfectly correct to be invalid. Unless I didn't understand your question...which is possible because I don't even know what is the startup time. It might help if you do a plunker. |
The problem you had, if I now understood correctly, might be related to issue #52 (please read until the end, since your problem is similar to what is discussed further down that issue) |
Sorry my bad English, Here my plunker: http://plnkr.co/edit/5egsZkBR4bg5hg8Wb5em?p=info
Dung Vu | Developer | Amigo Quant Edge JSC mobile: +849 0896 6639 <//mobile:%20+849%200896%206639> Amigo Quant Edge JSC tel: +84 (4) 7300 8999 <//tel:%20+84%20(4)%207300%208999> web: www.quant-edge.comThis message (including attachments, if any) is confidential, may be Amigo Quant Edge JSC assumes no responsibility for errors, inaccuracies or On Fri, Jul 24, 2015 at 6:54 AM, Ghislain B. [email protected]
|
Yes ok I see it better now with the plunker, nice demo by the way thanks. It should be fixed in coming version, I will not Oh but I just saw your "OK ???" after clicking the submit button, that seems to be a problem, I will look into that too |
I got your plunker to work, it is no more showing the "OK ???", you forgot couple of things which made the tool not to work. When you use <script src="https://rawgit.com/ghiscoding/angular-validation/master/vendors/angular-translate/angular-translate.min.js"></script>
<script src="https://rawgit.com/ghiscoding/angular-validation/master/vendors/angular-translate/angular-translate-loader-static-files.min.js"></script> and you also forgot to configure AngularTranslate myApp.config(['$translateProvider', function ($translateProvider) {
$translateProvider.useStaticFilesLoader({
prefix: 'https://rawgit.com/ghiscoding/angular-validation/master/locales/validation/',
suffix: '.json'
});
// load English ('en') table on startup
$translateProvider.preferredLanguage('en').fallbackLanguage('en');
}]); BUT there is something incorrect in your code, when you use <div class="row" ng-show="ModelData.IsShowNote">
<label class="col-xs-4 control-label">Note 2</label>
<div class="col-xs-6">
<textarea class="form-control" ng-model="ModelData.Note2" name="ModelData_Note2" ng-disabled="!ModelData.IsShowNote" validation="required"></textarea>
</div>
</div> |
And, if we have a lot of controls in block div, and we must remove all of them in GUI via ng-if or ng-show, as you comment in code I must set ng-disabled for each input in this block, right? |
I was looking at your code and I found out something that I did not know before, the I really don't know how to watch or trigger an At this moment, Angular-Validation library does not support |
Ok, I will check in next week, thank you. |
- Fixed issue #52, Changed default behavior of `ngDisabled` which was displaying error message right after an element became enabled, it will still pre-validate but not directly show the error message unless `preValidateFormElements` is set to True. - Look into the folder /more-examples/interpolate/ - Fixed issue #53, To support `ngIf` (add a trigger on element `$destroy`). - Look into the folder /more-examples/ngIfShowHideDisabled/
I found a way to trigger a You can find a demo under the folder And finally, I also fixed the red border that was showing at the beginning. So please use the new version v.1.3.38 Thank you for the great feedback! |
Many thank you, greate support :) |
If input controls is required and binding ng-disable=false, then in the startup time, it shows ng-invalid (red border). Could you check for this case?
The text was updated successfully, but these errors were encountered: