How to catch the "Login Failed" event? I want to show a custom block, only when log in has failed.
So from visibility settings I have to put a PHP code that returns TRUE only when the login has failed.

But how could I "catch" that event? Do I have to use variable_get(..)? And if yes, how could I use that?with what attributes?

Thank you.
You can use the rules module for this if you don't want to write PHP.

If you want it to be an ajax event you will need to write a custom login form.

The user.module has a set of functions you can call for validation: user_login_final_validate().

I suggest rules module, save yourself some time.