Skip to content
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

Need to use RequiredIf on a conditional based on checkbox list #192

Open
samgiordano opened this issue Sep 27, 2018 · 0 comments
Open

Need to use RequiredIf on a conditional based on checkbox list #192

samgiordano opened this issue Sep 27, 2018 · 0 comments

Comments

@samgiordano
Copy link

I have 3 checkboxes with the same Name field and each with a different ID field. This creates the value of the field as a comma separated string. Each checkbox has a conditional textbox they need to fill in if checked.

I tried using a RequiredIf on the textbox field using Contains on the Name of the checkbox field but it doesn't fire.

Its setup like this in my viewmodel:

`public string Three_Checkboxes { get; set; }

[RequiredIf("Contains(Three_Checkboxes, 'This is the value of checkbox one')", ErrorMessage = " * required")]
public string Checkbox_One_Textbox { get; set; }`

Any ideas what I can do to make this work?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant