Tagged: accessibility, WCAG
-
AuthorPosts
-
July 6, 2023 at 1:32 pm #1412616
I am working on a site to get it up to WCAG 2.2 and I have a few issues I need your help on.
First of all the contact form. I need there to be an error msg when trying to submit forms with wrong input, not just a red line around the field that is wrong. Also, and I am not sure if this is missing but I can not find it, autocomplete, is this implemented in the contact form?
Second, when running the site thru w3.org validator I get errors that I would like to know how to solve. Especially the following, “Attribute alt not allowed on element div at this point.” and “An element with role=menuitem must be contained in, or owned by, an element with role=menubar or role=menu.”
Any help would be greatly appreciated.
July 7, 2023 at 3:40 am #1412648Hey Advantage09,
Thank you for the inquiry.
1.) The contact form has an option to display missing or invalid fields. Please set the Content > Frontend > Display Fields With Error settings to “yes”.
2.) Adding the following script in the functions.php might help.
function ava_custom_script() { ?> <script> (function($) { $(document).ready(function() { $('#top #avia-menu').attr('role', 'menubar'); }); }(jQuery)); </script> <?php } add_action('wp_footer', 'ava_custom_script');
Best regards,
IsmaelJuly 10, 2023 at 1:23 pm #14129541. For some reason Enfold theme has not been updatet since Enfold 4.8.7. As this is a site I have taken over from someone else, I don’t know why this is. But this may be why there is no option to “display fields with error”? I am updating the site with the latest version of Enfold and hope this solves that problem.
2. This script did nothing, still got like 28 errors with the same errors “Attribute alt not allowed on element div at this point.” and “An element with role=menuitem must be contained in, or owned by, an element with role=menubar or role=menu.”
3. Another question in regards to accessibility is Landmarks. errors are “Document should have one main landmark” and “all page content should be contained by landmarks” Any tips on how to solve this?
Regards
NinaJuly 11, 2023 at 7:17 am #1413022Hi,
Thank you for the update.
2.) Did you just switch to a burger/icon menu? We updated the selector in the above script to apply the role attribute to the appropriate element. Please try it again.
function ava_custom_script() { ?> <script> (function($) { $(document).ready(function() { $('#top #av-burger-menu-ul').attr('role', 'menubar'); }); }(jQuery)); </script> <?php } add_action('wp_footer', 'ava_custom_script');
3.) The modifications described in the following thread may help in resolving the “landmark” issue.
// https://kriesi.at/support/topic/wcag-2-1-level-aa-and-landmarks/#post-1220909
Best regards,
IsmaelJuly 11, 2023 at 12:22 pm #14130381. The function provided worked for “An element with role=menuitem must be contained in, or owned by, an element with role=menubar or role=menu.” error. Thank you!
The second error is still there “Attribute alt not allowed on element div at this point.”
2. Another error I can’t figure out is “Certain ARIA roles must contain particular children” This is in reference to the burger menu.
3. The social share buttons on posts has a text above that reads “Share this post on” This is defined as H5. Is there a way to change this? Some pages does not have that many levels so it should not be a H tag.Regards
NinaJuly 11, 2023 at 12:45 pm #1413043Uptdating the theme helped with displaying form error mesage, but how can I translate the error message into Norwegian?
Regards
NinaJuly 13, 2023 at 1:32 pm #1413231Is there any answers to these questions?
July 13, 2023 at 5:54 pm #1413246Hi,
For “Certain ARIA roles must contain particular children” in reference to the burger menu please try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_change_burger_role() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function ($) { $(".menu-item-avia-special").attr('role','menu' ); })(jQuery); }); </script> <?php } add_action('wp_footer', 'custom_change_burger_role');
Best regards,
MikeJuly 17, 2023 at 5:22 pm #1413515This did not work as expected, instead it gave two more errors
“Broken ARIA menu
An ARIA menu does not contain required menu items.”Also: The social share buttons on posts has a text above that reads “Share this post on” This is defined as H5. Is there a way to change this? Some pages does not have that many levels so it should not be a H tag.
Regards
NinaJuly 20, 2023 at 11:44 am #1413828Hi,
To change your “Share this post on” to a “p” tag try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function change_share_elem_title_to_p_tag() { ?> <script> (function($) { $(function() { function replaceElementTag(targetSelector, newTagString) { $(targetSelector).each(function(){ var newElem = $(newTagString, {html: $(this).html()}); $.each(this.attributes, function() { newElem.attr(this.name, this.value); }); $(this).replaceWith(newElem); }); } replaceElementTag('h5.av-share-link-description', '<p></p>'); }); }(jQuery)); </script> <?php } add_action('wp_footer', 'change_share_elem_title_to_p_tag');
Best regards,
MikeJuly 21, 2023 at 7:42 pm #1413991Burger menu does not seem to be accessible to screen readers. I think this may be related to this error:
“Certain ARIA roles must contain particular children” This error shows up in Axe Dev tools and is in reference to the burger menu.
Any ideas on how to solve this?Regards
NinaJuly 21, 2023 at 8:11 pm #1413992Well, Günter is already working on it for the next version – to include improvements that are related to ARIA:
https://kriesi.at/support/topic/wai-aria/
in the meantime test this quick fix:function wai_aria_fixes(){ ?> <script> window.addEventListener("DOMContentLoaded", function () { (function($) { $('.avia-svg-logo a').attr('aria-label', 'SVG Logo'); $('.avia-standard-logo a').attr('aria-label', 'Logo'); $('.av-main-nav .av-burger-menu-main').attr('role', 'menuitem'); $('#av-burger-menu-ul').attr({ 'aria-haspopup' : 'true', 'aria-controls' : 'menu2', }); })(jQuery); }); </script> <?php } add_action('wp_footer', 'wai_aria_fixes');
July 22, 2023 at 1:40 pm #1414037 -
AuthorPosts
- You must be logged in to reply to this topic.