Over a million developers have joined DZone.

A Flex Alternative to 'Are You Sure' Dialogs

DZone's Guide to

A Flex Alternative to 'Are You Sure' Dialogs

· Web Dev Zone ·
Free Resource

A true open source, API-first CMS — giving you the power to think outside the webpage. Try it for free.

One of my pet hates in interaction design is the use of confirmation dialogs before the user attempts to do anything of worth. More often than not, with a bit of thought most user actions could be recoverable and rather than stopping the proceedings with idiocy the user could simply press 'undo' and return to their previous state.

One of my favourite articles bemoaning the use of modal dialogs is this one by Jeff Atwood.

However, sometimes a user's action isn't undoable. For instance, detonating an explosive charge ain't easy to undo. In scenarios like this, modal confirmation dialogs still aren't a real solution. Users don't read the text in dialog boxes and simply pressing 'ok' becomes habitual.

What's needed in these situations is a button that requires a definite and decisive user action and maybe my PressAndHoldButton does the trick. This requires the user to keep the button held down for some period of time before firing an event. 

The demo has three buttons - before any of those actions are performed, the user has to keep the relevant button depressed for five seconds.

The demo application is available here and the source code here.

The New Standard for a Hybrid CMS: GraphQL Support, Scripting as a Service, SPA Support. Watch on-demand now.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}