I should have explained why.. So i will now.
PHP is Server Side. Thus, all parsing is done on the server. From that it cannot contact the Client Machine. So if you wanted to have something like,
Client Click submit.. SHow error immediately it wouldnt work, as the Server has already Parsed the PHP. SO Javascript would be needed.
However. If you want to do it like this
eg..
Persons click invalid form, then re-show the form with the errors, than that is possible.
Im not a Javascript Guru, so i dont think id be a worthy teacher of it yet. But you can take a look at http://www.w3schools.com/jscript/ they have a good Validation Example.