November Happy Hour will be moved to Thursday December 5th.

aria-invalid remains false despite validation failed

Vote:
 

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?

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

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

#297866
Mar 07, 2023 16:39
Vote:
 

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

#297908
Mar 08, 2023 11:40
Vote:
 

The problem was that FormContainerBlock.cs had commented line:

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

Uncommenting the above line helped with the case.

#298175
Edited, Mar 13, 2023 10:31
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.