Like other people said, inline errors is more user friendly. To add to this, pop-ups should be used (if anything) on finished tasks, success messages, etc, but user has to be able to see what errors has he/she made in order to make the appropriate corrections. And for this, you need some kind of inline display.
Now, in this scenario (and based on your screen capture as well), the most common way to display these errors is ON SUBMIT, which is correct, but can be enhanced by using AJAX requests, so errors can be corrected immediately as soon as the form is being filled.
This way, your users won't have to submit the form, you'll be able to tell them EXACTLY how you want the data to be provided and you won't have "faux submission" that mess your statistics.
The data formatting problem is specially true with password fields since you'll need to enter (and re-enter) passwords every time the page loads, and this is a very common UX error. You'll also see this issue on date (when using text fields), credit card numbers, etc. And it's as simple to solve as to perform an asynchronous request and some validation before submitting anything. Furthermore, you can "mute" the submit button until validation is successfully performed