If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I would submit all the fields as once (e.g., submit the whole form) to the validation PHP script, and have the script return a JSON object with all the validation results, which the JavaScript response handler could then loop through.

At that point, it really becomes a JavaScript question. If you're using JQuery, it should be relatively easy to loop through the JSON object and apply it to the form elements -- just make sure that (a) you have useful id elements in each HTML form element so that your JQuery can easily reference them, and that your PHP returns those ID's in its response elements (e.g. it's easiest to make the ID and the form name the same:

With that, if you get an error message for "last_name", you could just reference "last_name_error" as the element to add your error text to (or clear its value if that field no longer has an error but some other field does).

And I suspect the real JavaScript experts here (I'm a hack, at best) could give you better ideas.

html5 has built-in validation for form fields and there are polyfills for non-compliant browsers.
that should be enough to "generate errors at the front of each field on keyup".
in a situation where a user signs up or logs in, i would rely on php to validate authentication.
10 times out of 10 you can bypass javascript, not to mention you can submit the form to the server without a web browser or even from the page the form is on.