As with everything: user test! Thankfully, usability hero Jakob Nielsen jumps to the rescue here in his Alertbox article about OK/Cancel buttons:
Should the OK button come before or
after the Cancel button? Following
platform conventions is more important
than suboptimizing an individual
Kostya was right on the mark in advising adherence to platform guidelines. But what about web-based platforms?
If you’re designing a Web-based application, the decision is harder, but you should probably go with the platform preferred by most of your users. Your server logs will show you the percentage of Windows vs. Mac users for your specific website or intranet. Of course, Windows generally has many more users, so if you can’t be bothered to check the logs, then the guideline that will apply to most situations is OK first, Cancel last.
He also mentions two additional important guidelines you might consider when creating OK/Cancel buttons:
- It’s often better to name a button to explain what it does than to use a generic label (like “OK”). An explicit label serves as “just-in-time help,” giving users more confidence in selecting the correct action.
- Make the most commonly selected button the default and highlight it (except if its action is particularly dangerous; in those cases, you want users to explicitly select the button rather than accidentally activating it by hitting Enter).
The answer is in user interface guidelines for the system you use.
Present the commit buttons in the following order:
- OK/[Do it]/Yes
- [Don’t do it]/No
- Apply (if present)
- Help (if present)
So Cancel is always on the right of OK button.
A button that initiates an action is furthest to the right. The Cancel button is to the left of this button.
So for MacOS users Cancel is on the left of OK button.
The dismissive action of a dialog is always on the left. Dismissive actions return to the user to the previous state.
The affirmative actions are on the right. Affirmative actions continue progress toward the user goal that triggered the dialog.
For Android, Cancel is on the left of the OK button.
For other systems see guidelines.
Think “reading” metaphor. Westerners read left to right, our brains are conditioned to flow left to right. CANCEL is basically a step backwards (left) and OK/SUBMIT/YES/Etc., are a step forward (right).