Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the most Cocoaish way to show that a text field is invalid?

I have a text field which is validated whenever it loses focus. I want to be able to indicate that the value invalid during input so the user has the opportunity to correct their mistake before explicitly moving focus away from the box and triggering validation.

I have seen various implementations, including placing a red border round the field, a little icon that comes up for invalid input, or a bit of warning text.

What is the best way to do this in a way that complies with the conventions of Cocoa and the Apple Human Interface Guidelines?

like image 869
Joe Avatar asked Aug 10 '10 11:08

Joe


1 Answers

Set its background to light red. This is what Adium does when you go over the message length limit in a Twitter tab.

The specific color Adium uses is:

  • Hue: 0.983
  • Saturation: 0.43
  • Brightness: 0.99
  • Alpha: 1.0

as a calibrated (Generic RGB) color.

like image 104
Peter Hosey Avatar answered Oct 13 '22 09:10

Peter Hosey