WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Using "alert" or "confirm" javascript functions in place of modal dialog box, is that a bad practice?

for

From: Donald Evans
Date: Mar 19, 2012 9:57AM


I will always recommend a JS alert as it is truly modal. Many of the
libraries have what visually look like modals and are to the mouse user,
but as you know not for the screen reader or keyboard only user.

I often do get push back from developers because the JS alert can not be
styled with CSS to look the way they want it to look. This is the only
reason I know of to not use it. Personally I think that is a lame reason,
but when you are working with companies that have paid a lot of money to
have a style and brand developed it can be a problem.


On Mon, Mar 19, 2012 at 11:41 AM, Birkir R. Gunnarsson <
<EMAIL REMOVED> > wrote:

> Hi everyone
>
> At Access U and CSUN we had some discussions regarding modal dialog
> boxes, and how screen readers can easily get around them, thus
> potentially confusing the end users.
> I recommended using the Javascript alert function to get around this
> for a page I consulted on recently, and we have not gotten any
> complaints about it, at least not yet.
> Yesterday I was reading entries on the W3Fools website (page that was
> set up to point out problems with W3Schools, no association with the
> W3C).
> Under the Javascript section it says that using alert() or confirm()
> is bad practice and it should be avoided, though it gave no further
> explanations.
> Does anyone have any thoughts on this either way?
> Cheers
> -B
>