Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-required validation not working properly with true/false radio values. #2594

Closed
@michaelmoussa

Description

@michaelmoussa

See Fiddle.

I have a use case where radio input data is stored server-side as booleans - true for "yes", false for "no".

If I use value="true" and value="false" on my form, the radio control corresponding to the default value is not selected when the page loads (validation, however, works as expected).

If I use ng-value="true" and ng-value="false" instead, the default value is selected automatically based on the model as expected, but validation doesn't work correctly. The form is only declared valid if "Yes" is selected, but still invalid if "No" is selected.

I can't select "no" by default because the business rules say that the inputs should initially be unselected (presumably so the user has to actually go through the whole form and answer the questions instead of just skipping ahead because an option has already been selected for them).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions