adjust text input color by name validity