WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: role="alert" now in div but still not being read byNVDA

for

From: Greg Gamble
Date: May 17, 2013 4:30PM


Bryan

I got it to work ... kind of.



I'm using jQuery as shown ... $('#ErrorMsg').attr('role', 'alert').show('').html('Email or password incorrect');



$('#ErrorMsg') is the hidden div I'm showing: <div id="ErrorMsg" class="alert alert-error hide"></div>



The show() is taking the hidden div tag and bringing it to visibility with a display:block. Only after I added an empty string to the show() method does NVDA now recognize the div tag and read the role=alert.



I'm still trying to find out what the difference is between .Show() and .Show('') is.



Looking at your code from unobtrusive_announce.js.txt, I see your basically creating a hidden alert box, and injecting the text to be announced. That got me thinking on why my code was not working. I guess I should see if I can create some kind of helper method for all the validator functions so they do something along the same lines ....



Thanks for the help ...



Greg Gamble
Information ServicesWashington State Board for Community & Technical Colleges
1300 Quince St SE | PO Box 42495 | Olympia, Washington 98504
p: (360) 704-4376
e: <EMAIL REMOVED> <mailto: <EMAIL REMOVED> > | www.sbctc.edu<;http://www.sbctc.edu/>;