Accessibility - "Lang" on html
Question

Hello,

I'm developing a Web Application wich has to be verified about the accessibility. The only problem I'm facing is that the "language" of the portal is not definied on the begining of the html document, I already injected the "lang" to html string through JS in the preparation but it still adds the language after page is completly loaded, and the accessibility portal assumes that the "Lang" is not definied. I presume that is because the attribute doesn't come with the inicial script.

Can someone help me on this pls?

mvp_badge
MVP
Solution

Hi Francisco,

Where does the "lang" attribute need to be defined? Is it in the <HTML> tag of the page?

Have you checked out the HTTPRequestHandler extension? The AddAttributeToHtmlTag method looks promising:

Afonso Carvalho wrote:

Hi Francisco,

Where does the "lang" attribute need to be defined? Is it in the <HTML> tag of the page?

Have you checked out the HTTPRequestHandler extension? The AddAttributeToHtmlTag method looks promising:


This exactly what I need, thank you very much. 

mvp_badge
MVP

No problem. If you need to do any other changes to the page content that lives "outside" of the <body>, the HTTPRequestHandler extension will probably have you covered.

Hi Afonso Carvalho,

I am using the same function however its not working for me, I checked service center and its throwing "Index and count must refer to a location within the string.
Parameter name: count" error, If I disable the function preparation loads the screen without an error. So error is raised after using 'AddattributetoHTMLTag' function.
Could you please advise?

Appreciate your help,


Thanks,
Sneha

No problem. If you need to do any other changes to the page content that lives "outside" of the <body>, the HTTPRequestHandler extension will probably have you covered.



mvp_badge
MVP

Hi Sneha,

What are you placing in the Name and Value inputs of the action? Are you doing any operations or are they just strings?

Hi Afonso,

Do I need to add AddAttributeToHTMLTag action in all screen preparation?

mvp_badge
MVP

Hi Aditi,

Yes, I believe so. The action will affect the current request, so if you need this tag in all pages, it must be present in all screen Preparations.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.