I have the following source in an mvc .cshtml page.
@Html.LabelFor(m => m.CollegeListQuestionnaireFamilys[index].FirstName, "First Name")
@Html.TextBoxFor(m => m.CollegeListQuestionnaireFamilys[index].FirstName, new { maxlength = 50, aria_required = "true" })
@Html.ValidationMessageFor(m => m.CollegeListQuestionnaireFamilys[index].FirstName)
When an invalid entry is made the page renders the following:
<label for="CollegeListQuestionnaireFamilys_0_FirstName">First Name*</label>
<input aria-required="true" class="input-validation-error" data-val="true" data-val-length="The field FirstName must be a string with a maximum length of 50." data-val-length-max="50" id="CollegeListQuestionnaireFamilys_0_FirstName" maxlength="50" name="CollegeListQuestionnaireFamilys[0].FirstName" type="text" value="" aria-invalid="true">
<span class="field-validation-error" data-valmsg-for="CollegeListQuestionnaireFamilys[0].FirstName" data-valmsg-replace="true">Family Tab: Parent/Guardian First Name is required.</span>
How do I get ValidationMessageFor() to include an AriaDescribeBy connection to the error text?
For Example:
<label for="City">City/Town*</label>
<input aria-required="true" class="input-validation-error" data-val="true" data-val-length="The field City must be a string with a maximum length of 50." data-val-length-max="50" id="City" maxlength="50" name="City" type="text" value="" aria-invalid="true" aria-describedby="CityError">
<span class="field-validation-error" data-valmsg-for="City" data-valmsg-replace="true" id="CityError">Basics Tab: City/Town is required.</span>

