Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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.

    #1412648

    Hey 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,
    Ismael

    #1412954

    1. 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
    Nina

    #1413022

    Hi,

    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,
    Ismael

    #1413038

    1. 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
    Nina

    #1413043

    Uptdating the theme helped with displaying form error mesage, but how can I translate the error message into Norwegian?

    Regards
    Nina

    #1413231

    Is there any answers to these questions?

    #1413246

    Hi,
    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,
    Mike

    #1413515

    This 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
    Nina

    #1413828

    Hi,
    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,
    Mike

    #1413991

    Burger 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
    Nina

    #1413992

    Well, 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');
    #1414037

    Hi,
    Thank you for sharing Guenni007

    Best regards,
    Mike

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.