Using Episerver.Forms, after submitting data, when there are validation errors, aria-invalid remains false.
Part of HTML after form submission for Type = Text where Validators is set to Required:
<div class="Form__Element FormTextbox FormTextbox--Textarea ValidationRequired" data-f-element-name="__field_51634" data-f-modifier="textarea" data-f-type="textbox"> <label for="57e5707b-5a25-4494-b25a-660498a84fa0" class="Form__Element__Caption">First Name</label> <textarea name="__field_51634" id="57e5707b-5a25-4494-b25a-660498a84fa0" class="FormTextbox__Input" placeholder="" data-f-label="First Name" data-f-datainput="" required="" aria-required="true" aria-describedby="__field_51634_desc" aria-invalid="false" autocomplete="off"></textarea> <span class="Form__Element__ValidationError" data-f-linked-name="__field_51634" data-f-validationerror="" id="__field_51634_desc" role="alert">This field is required.</span> </div>
Is that a bug or configuration issue?
I would reach out to Opti support to see if this is a known issue.
Thank you, Aniket. I reached Opti for that problem.
The problem was that FormContainerBlock.cs had commented line:
@await Html.PartialAsync("FormContainerInitScript", Model)Uncommenting the above line helped with the case.
Using Episerver.Forms, after submitting data, when there are validation errors, aria-invalid remains false.
Part of HTML after form submission for Type = Text where Validators is set to Required:
Is that a bug or configuration issue?