RequiredIf fails on client side with radio buttons.

Jan 4, 2011 at 2:38 PM

Hi I have the following. 


public String rdoAppTypeOptions { get; set; }

[RequiredIf("rdoAppTypeOptions", "This is One", ErrorMessage = "Please select one option")]
public string rdoSelfFundingOptions { get; set; }

Yes&#160;<%: Html.RadioButtonFor(model => model.rdoSelfFundingOptions, "Yes") %>&#160;&#160; 
 No&#160;<%: Html.RadioButtonFor(model => model.rdoSelfFundingOptions, "No") %>
<%: Html.ValidationMessageFor(model => model.rdoSelfFundingOptions) %>

When "This is One" option is selected on the radio button rdoAppTypeOptions, the value of the rdoSelfFundingOption is always yes, whether if it is selected or not, and then the validation on the client side fails, but it comes back from the server, therefore the validation is applied but not on the client side.

Does anyone had this issue before? if so, How did you fixed?

Thanks in advance.