For security you do absolutely want to clear the fields as not doing so adds another way in which passwords will travel around in plain text (as part of the request's form variables).
What is inline validation ux?
In short, inline validation is an effort on behalf of the form to help users correct information as they go, ideally so that when the point comes to submit the form, they are more likely to submit it on the first attempt. The more failed attempts a user makes to submit the form, the more likely they are to give up.