2

I'm writing a page where I'm going to need to use a confirmation dialog.

Should I use Window.confirm() which opens a confirmation dialog in the browser using whatever settings are native to the browser?

Should I use a js library to create my 'own' modal confirmation dialog?

Or is there some other third option like opening a different page?

What would feel the most 'natural' for the users? I can tailor my 'own' confirmation dialog to match the format of the site, but would using the native browser one make it more natural for the users (especially since the browser might tailor it for various operating systems?)

Edit: (Not sure whether this is pertinent) - It's a pay-to-use web application for the general public. The audience is expected to be at least slightly tech-savvy because of the nature of this product. It's going to be international and OS/Browser agnostic. The confirmation dialog would be used for terminating the account for instance.

  • Depends on your audience and project. Please add more details. – msp Sep 25 '14 at 8:13
  • I've added this information. Not sure whether it's pertinent. – user2110845 Sep 25 '14 at 8:19
  • Some relevant thoughts in this question: Thoughts on Customizing Javascript Confirm Dialog – Matt Obee Sep 25 '14 at 8:45
  • avoid confirmation dialogs wherever you can! – daniel Sep 26 '14 at 11:41
  • @zoidbergi - I understand that. But something dangerous like deleting one's own account shouldn't happen without one I feel. – user2110845 Sep 26 '14 at 13:22
6

My rule of thumb is to use custom dialogs whenever possible. Lately, I've been using jQuery's modal dialog for this, but that's just because we're already using jQuery on our current project. This allows you to customize the look and feel to match the rest of your site. It also allows you to modify button text appropriately.

For example, with the OS dialog, you're limited to "OK" and "Cancel", meaning you have to phrase the message carefully to prevent confusion.

"Press OK to verify that you would like to delete your account."
OK | Cancel

But, with a custom dialog, you can make the text friendlier and use the button labels as answers to the question ("Yes" or "No").

"Are you sure you want to delete your account?"
Yes | No

  • 1
    Very valid points. To add to this (since I've done some research on it) - Microsoft UX Guidelines suggest that most people tend not to read the 'message', so it is recommended that the button itself has a clear explanation of what it does. So better than "Yes" "No" - "Delete my Account", "Cancel" – user2110845 Sep 26 '14 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.