How to execute javascript from within an ajax request
Not sure of how you are making the AJAX call, but jQuery AJAX calls such as $.ajax let you execute a callback after the result has been returned. I recommend returning FALSE or a code indicating an error to your calling function and placing your "validation failed" logic inside of that in the success handler.