Accessibility - "Lang" on html

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?

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:

Solution

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. 

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.



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?