aria-invalid remains false despite validation failed


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>

Is that a bug or configuration issue?

Mar 07, 2023 11:33
Praful Jangid - Mar 09, 2023 16:19
Can you share the screenshot of how your form field is configured?

I would reach out to Opti support to see if this is a known issue.

Mar 07, 2023 16:39

Thank you, Aniket. I reached Opti for that problem.

Mar 08, 2023 11:40

The problem was that FormContainerBlock.cs had commented line:

@await Html.PartialAsync("FormContainerInitScript", Model)

Uncommenting the above line helped with the case.

Edited, Mar 13, 2023 10:31
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.