WebAIM - Web Accessibility In Mind

E-mail List Archives

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

for

Number of posts in this thread: 4 (In chronological order)

From: Birkir R. Gunnarsson
Date: Mon, Mar 19 2012 9:45AM
Subject: Using "alert" or "confirm" javascript functions in place of modal dialog box, is that a bad practice?
No previous message | Next message →

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

From: Donald Evans
Date: Mon, Mar 19 2012 9:57AM
Subject: Re: Using "alert" or "confirm" javascript functions in place of modal dialog box, is that a bad practice?
← Previous message | Next message →

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 ADDRESS 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
>

From: Steve Faulkner
Date: Mon, Mar 19 2012 10:24AM
Subject: Re: Using "alert" or "confirm" javascript functions in place of modal dialog box, is that a bad practice?
← Previous message | Next message →

Good news is that there will be a dialog feature added to HTML5 that will handle the interaction and semantics.

But will take a while before its implemented.

Sent from my iPhone

On 19 Mar 2012, at 15:55, Donald Evans < = EMAIL ADDRESS REMOVED = > wrote:

> 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 ADDRESS 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
>>

From: subhash chhetri
Date: Mon, Mar 19 2012 10:39PM
Subject: Re: Using "alert" or "confirm" javascript functions in place of modal dialog box, is that a bad practice?
← Previous message | No next message

On 3/19/2012 9:11 PM, Birkir R. Gunnarsson 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
>