1
votes

I have a <div> to display error message & have given the attributes aria-live="assertive". When the voice over reads, it reads "Error Message .clickable"

I want the Voice Over to read only the error message not "clickable".

The structure is something like this

<div id="fnErr" aria-live="assertive">
<form:errors path="firstName" cssClass="error" htmlEscape="false"/>
</div>
<label id="fNlbl" for="fN">
<spring:message ..... />
</label>
<form:input aria-required="true" type="text" tabindex="0" path="firstName" maxlength="90"     id="fN" class="" cssErrorClass="" />

In the rendered HTML it comes out like:

<div errMsg>
<span>---error content-----</span>
</div>

Can anybody help?

2

2 Answers

1
votes

Use one of the following techniques to suppress the clickable:

  • Text input with disabled attribute

    <input type="text" disabled="disabled" maxlength="13"><spring:message .... /></input>
    
  • Text input with readonly attribute

    <input type="text" readonly="readonly" maxlength="13"><spring:message .... /></input>
    
-1
votes

As is not clickable element, if you want to make it clickable then we need to add the role attribute in element.

<div errMsg role="button">
<span>---error content-----</span>
</div>