I'm working in ASP.NET MVC 3 and I'm running into an odd problem. I got a checkbox set up so the user must check it to indicate they have read the disclosure and continue. They cannot continue if they don't check this. That all works.
If they do not check the box, the validation message pops up as required, and the label is displayed in red. However, when I check the box, the label disappears with the validation message. What would cause this? I'd like the label to stay put. ;) Here's the code in the view:
@section StepContent
{
<div>
@Html.LabelFor(m => m.ApplicantAgreesToDisclosure)
@Html.CheckBoxFor(m => m.ApplicantAgreesToDisclosure)
@Html.ValidationMessageFor(m => m.ApplicantAgreesToDisclosure, "Please indicate that you agree to the disclosure.")
</div>
}
And the code in the Model:
[DisplayName("I have read and accept the above disclosure")]
[ESignatureRequiredValidation(ErrorMessage = "Please indicate that you agree to the disclosure.")]
public bool ApplicantAgreesToDisclosure { get; set; }