I have a dialog that upon opening performs some data validation (none of the data visible). The dialog is determining whether an action can be taken or not.
The dialog has only two buttons - OK and Cancel. Cancel always closes the dialog without taking any action.
I am unsure about how the OK button should behave. If data validation passes, the OK button is intended to take some action against the database. If data validation does not pass I feel like I could do any of the following:
- Disable the OK button so the user can only click Cancel.
- Have the OK button execute the same action as Cancel (silently close the dialog).
- Display a message that says something to the effect of "This action is unavailable because blah blah blah".
Here's the way I am leaning and why.
I don't like #2 because it seems like the button is doing different things and the user is not aware of it. Did the dialog do what I wanted when I clicked OK or did it just close? I have no idea.
I like #3 slightly better than #1 because the user is allowed to attempt the action (i.e. clicking OK) but is told very clearly that they are not allowed to do so.
I am potentially OK with #1, but am concerned that a stubborn user may feel aggravated that the OK button is disabled without a clear reason as to why.
Are there any standard UX cues I can follow with this design?