Learn more about my newest book, "Designing the Moment"!

Design Stories: OK/Cancel buttons

OK and Cancel buttons are omnipresent on the web. Of course, they aren’t always labeled OK and Cancel and they don’t always have the same purpose, but we’ve seen them a million times nonetheless. The combination of the two buttons has maintained its position as a global standard for a very good reason: almost any action you perform in a web application can be canceled. This is seen often in round-trip interactions, in which the user starts an interaction on Page 1, completes it on Page 2, and is then returned to Page 1. It’s also seen in inline interactions, such as changing the title of a Backpack page.

Typically, the set of buttons is displayed as two side-by-side HTML buttons. This is true in many desktop applications as well. Sadly, this design has persisted for years and has found its way into millions of apps. See, the unfortunate side-effect of standards is that people often stop questioning them, and progress almost completely stops regardless of whether the standard is the best solution.

Here’s a typical OK/Cancel button set:

SaveCancel_11.jpg

In this case, the object of the interaction is to create or edit a title and then either save or cancel it. Simple enough. So what’s the issue? Well, there are numerous ways to solve any given design problem, and even something as simple as this requires a few decisions.

The first decision to make is about the position of the buttons. It really doesn’t matter much in terms of usability whether the buttons are right-aligned or left-aligned to the field above it, but I generally stick to the left side for a few reasons. First, left-alignment keeps everything flush to the left edge, forming a nice, straight line from the top of the form to the bottom. Second - and this is simply an aesthetic choice - it seems to create a visual “end” to the form. As you complete each field, you move steadily downwards, and placing the action buttons at the tail end of it seems to anchor the form. But that’s just me. The most important reason will be explained in a moment.

The second decision to make is how to label the buttons. Sure, using the standard OK and Cancel requires less effort on a case-by-case basis, because you can simply label them without really thinking about it and move on, but are these terms really helpful? “OK” will work fine in a lot of cases, but more meaningful button labels can go a long way towards setting a user’s expectations about the result of clicking the button.

What does clicking OK do in this example? It probably saves the title. But elsewhere in the application, saving a setting might return the user to the page where he started the interaction, such as a Profile page. In that case, simply clicking OK doesn’t set a clear expectation. There, we should use something like, “Save and return to profile”. And since that’s true, we should maintain consistency and use meaningful button labels everywhere in the application.

On a more basic level, it’s simply more polite for us to set clear expectations regardless of what the user is doing. It makes things more understandable for them, and it makes us look good as a result. Do you need more reasons than that?

Despite all this long-winded logic, labeling the button in a meaningful way is really no big deal.

SaveCancel_2.jpg

All we really need to do is change the label from OK to “Save title”. Rather painless.

The final thing to think about here is the thing that goes unchallenged by designers most frequently. It’s the fact that equal weight is often given to both buttons, the two of which trigger remarkably different results. I can understand why this started. Two options equates to two buttons. But this is not what we want to do. Instead of thinking about the number of options, think about the most likely option.

The most likely option for users who have decided to create or edit this title is to save the changes. The less likely option is to cancel the changes. But by giving both buttons equal amounts of visual importance, users have to actually read the labels - on both buttons - to decide which one to click.

Applying Fitts’ Law, which dictates that the time it takes to hit a target is a function of the distance to the target and the size of the target, the ideal solution is to take some of the focus away from the Cancel option by turning it into a text link.

SaveCancel_32.jpg

(UPDATED: I changed the link color to black in this screenshot and removed the underline. Those who left comments here are right - a standard blue, underlined link stands out too much. Thanks for your contributions.)

This way, the “Save title” button is prominent and easier to hit with the mouse, while the Cancel link is less prominent and slightly less easy to hit with the mouse. Is it any more difficult to see both buttons? No. But it’s slightly more difficult now to click the wrong one. Your eye is drawn to the large button. And it’s easy to recognize, subconsciously, that the large button is the probably the one you want to click.

This, incidentally, is also why I prefer to keep the buttons left-aligned. It simply looks better to have that large HTML button aligned to the left edge of the field above it than it would to align the Cancel link to the right edge.

So why is it so important to keep the button on the left and the text link on the right? Because any user who uses the Tab key to move through form fields will reach the “Save title” button first, again putting focus on the most likely choice while simultaneously taking focus away from the less likely choice.

UPDATE: Jakob Nielsen has posted an Alertbox article called “Command links” that provides guidelines for when to use text links to trigger commands. His recommendations are very much in line with the example I’ve offered in this post. He recommends using command links for:

  • Actions with minor consequences, since users might click something that looks like a link with the expectation that all it’ll do is bring up a new page. In a brokerage application, for example, continue to use a button for the “buy this stock” command.
  • Secondary commands, since users will scan the screen for a button when they’re looking for the “serious” or main commands. Thus, you should display the commands that are most important — whether from the user’s perspective or your own — as buttons. For example, continue to use a button for “add to shopping cart.”

Posted by Robert on January 5th, 2007





8 comments

Brammeleman said:

Very nice!
I was looking for the html-tags for a cancel button when I stumbled upon your article. Directly decided to adopt your design.
For some users it would also be move clear where the cancel link will bring them by inspecting the status bar.

Posted on January 7th, 2007


Michael Zuschlag said:

+1 to labeling buttons with what they actually do, and avoiding “OK” or geekese “Submit.” Most desktop style guides have been recommending such labeling for years. It’s time the web caught up to this.

I’m also for using variable size controls to capitalize on Fitts Law, but of course it only helps to make the Cancel control smaller if the freed space is used to make the execution control larger. From the Fitts perspective, the illustration above makes it harder to hit the less common control with no benefit for the more common control, a net loss for user performance.

Actually, maybe you can eliminate the Cancel link entirely, assuming there’s the usual links on the page to navigate back (e.g., a menu on the side). Most pages don’t have a Cancel link; why do you need one just because it has an execution button? Properly labeled links are much better than expecting the user to check and decode the status bar for where they’ll go. On the other hand, if you need Cancel in order to do something beyond just navigate (e.g., resetting fields to their default values), then I think it should be a button. Links should link and should do nothing else.

Posted on January 8th, 2007


Robert said:

I definitely agree that in some cases, the Cancel link is simply unnecessary. The examples I used, however - round-trip interactions and inline editing interactions - are examples of when a Cancel option makes sense.

Thanks for asking questions like this, though. All the feedback I get on these Design Stories helps me better anticipate the questions I need to address in future posts.

Posted on January 8th, 2007


Rob said:

Hey Robert, enjoying these Design Story articles - it’s great to see the thought process behind different decisions.

I do, however, disagree with “This way, the “Save title” button is prominent”. Glancing at your examples, the ‘Cancel’ link stands out a *lot* more due to its colour.

Perhaps this could be fixed with styling but given users scan for links, I think it could be an issue.

Just a thought…

Posted on January 9th, 2007


Peter Parkes said:

I have to say that I agree with Rob — the blue, underlined ‘Cancel’ link stands out a lot more than the greyish ‘Save title’ button.

Still, as Michael says, any form that does away with generic button titles gets bonus points.

Posted on January 10th, 2007


Andres said:

Great reflexion! Nonetheless I find out that very few forums talk about what button should go on the right and/or Left. Meaining should a confirmation or ok button be on the left side of the cancel button or vice-versa? Most of the sites have cancel button at the right of the “ok” or “save” button I would rather use the “ok” at the right of any “cancel” button. Why? Because I do beleive that seeing “ok” most to the right will set expectaion on next step to be follow. Any comments on this?

Posted on June 7th, 2007


chieri said:

andres, i totally agree with you. the most likely option (save or ok button) should be the rightmost (and this is because the majority is right-handed, imo) it is nice to know that someone else has thought about this.

Posted on January 15th, 2008


rhjr.net » ideas worth stealing » Conquer the Control Freak in Charge (CFIC) said:

[...] The CEO, however, arbitrarily decided that all OK/Cancel button sets should be labeled … “OK” and “Cancel”. And the buttons should be identical to each other. (Naturally, I disagree.) [...]

Posted on June 19th, 2008


post a comment

Name (required)