If you're replacing the button with an anchor, then you're no longer submitting the form? Clicking the link won't send the loginName
parameter - because it's not submitting the form.
If you want to replace the button with a link, then you'd need to use Javascript to submit the form when you click the link.
Give the form a name:
<form name="myForm" action="${flowExecutionUrl}&_eventId=loginCredentialsEntered"
method="post">
And modify the link to:
<a href="#" onclick="document.myForm.submit();">Login</a>
Alternatively, a better solution would be to leave the button and use CSS to style it more like a link. Then there would be no Javascript needed.