Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Radio button required field validation not working #181

Description

@PrashantP25

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions