You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
Hi,
While working on a use-case where we need required field validation on radio button, we encountered that, when we add validation via code i.e using object.addValidator, on blur, validation message is not getting populated in error span. Where as when we use attribute validation it just works fine. In our use-case we use ghiscoding method to add validation for which radio buttons required field validation is not working. After investigating this issue we found a fix in "Validation-Service.js" file.
I have created plunker ( Click Here )
It has all required files and 2 versions of your JS file.
ghiscodingwithfix has the fix. Please try changing references in index.html.
The fix that was done in file Validation-service.js are:
on line number 109, we need to replace var validationPromise = attemptToValidate(self, event.target.value, 0); line with var validationPromise = attemptToValidate(self, (attrs.ctrl.$modelValue == undefined ? '' : attrs.ctrl.$modelValue),0);
on line number 577 we need to replace var validationPromise = attemptToValidate(self, event.target.value, 10); line with var validationPromise = attemptToValidate(self, (attrs.ctrl.$modelValue == undefined ? '' : attrs.ctrl.$modelValue),10);
Can you please accommodate these changes in repo?
If you are ok, I will create a PR and let you know for approval
Thanks,
Prashant
The text was updated successfully, but these errors were encountered:
Hi,
While working on a use-case where we need required field validation on radio button, we encountered that, when we add validation via code i.e using object.addValidator, on blur, validation message is not getting populated in error span. Where as when we use attribute validation it just works fine. In our use-case we use ghiscoding method to add validation for which radio buttons required field validation is not working. After investigating this issue we found a fix in "Validation-Service.js" file.
I have created plunker ( Click Here )
It has all required files and 2 versions of your JS file.
ghiscodingwithfix has the fix. Please try changing references in index.html.
The fix that was done in file Validation-service.js are:
on line number 109, we need to replace
var validationPromise = attemptToValidate(self, event.target.value, 0);
line withvar validationPromise = attemptToValidate(self, (attrs.ctrl.$modelValue == undefined ? '' : attrs.ctrl.$modelValue),0);
on line number 577 we need to replace
var validationPromise = attemptToValidate(self, event.target.value, 10);
line withvar validationPromise = attemptToValidate(self, (attrs.ctrl.$modelValue == undefined ? '' : attrs.ctrl.$modelValue),10);
Can you please accommodate these changes in repo?
If you are ok, I will create a PR and let you know for approval
Thanks,
Prashant
The text was updated successfully, but these errors were encountered: