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; }`
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!