I'm not too familiar with the type of validation you are using. It seems that if you can conditionally include the progress bar script that is being referenced in the head then you should be able to delay execution of the progress bar until the validation is successful.