The system form I develop is full of alerts to warn the user that he can not leave that field unfilled and such. The problem is that the alerts are very annoying, and so I wanted to replace only with a color change in the input that he clicked, did not write anything, and then clicked off. In addition, it would be interesting to get a message when he clicks the button, such as the Facebook registration form (do the test clicking the field and then clicking outside). I know that nobody here works for me, for that very reason, if they helped me with which javascript event I would have to use to work this way would already be of great help.
For example, would I use an onkeypress, onclick, onblur ?? Another thing? I do not know.
And to make the message appear without being through a div with display none, would it be through a kind of validate massage ?? I do not know.
Help me
Ps. Developing in jsf + primefaces