Reputation: 18918
Let's say I have a dialog that pops up to ask the user for some information. Since there is already a close button in the window corner to cancel input, should I add another "Cancel" button accomplishing the exact same function?
Upvotes: 1
Views: 101
Reputation: 478
Yes, the end result is same with default close button (X) and custom 'Cancel' button. However, with Cancel button you will always have more control on how you want to close the dialog. You can also have the event handler for close button but how you can use it (if you can) will vary from language to language and how you are creating that dialog box, is it in built or a custom screen etc.
Also, providing Cancel button makes UI looks complete/balanced. User gets feeling of that they have either way to choose from and not forced in one way traffic. So having a Cancel button is a good idea.
Upvotes: 1
Reputation: 1646
I think it's best practice to explicitly state the available functions but trap the close window action to perform the 'cancel' operations if necessary. It's not standard practice to operate as you suggest and the user is left making an assumption, which is never good.
Upvotes: 1
Reputation: 22957
When it comes to programming a UI, you always want to pretend that everyone who uses it is computer illiterate. Ask yourself, "Would my grandma know how to accomplish this?"
Of course, this doesn't hold true in every single case, but its right on the majority of the time. So, my advice would be if you have to ask the question, then you already know the answer: Include a Cancel button.
Upvotes: 1
Reputation: 56779
Users like it when the interface is clear and predictable. 'Close' importantly does not specify whether the user's information will be saved or not.
I would suggest you give the user precisely 2 options - one that closes the box while accepting the user's input (such as Submit) and one that closes and unambiguously ignores the user's input (such as Cancel).
Upvotes: 1