The main thing is that by using <button>Login</button>, the form's onsubmit event won't fire. Try putting an alert right at the top of validate_login(thisform) and you will find that it's never called.

Error messages are passed to validate_required as alerttxt , but alerttxt is not used. You probably want alert(alerttxt); as per validate_email.

validate_login, in its current format, never returns true so would always suppress form sumbission (This is not relevant if you stick with <button> and adopt my alternative formulation of validate_login above).

I don't really want to use javascript to submit the form for usuablitiy, I'm vailidating server side with php, this is just for style really.
Using the method at the moment with the button as the submit is triggering the onsumbit. I tested it with the method you mentioned it.

In that case you must use <input type="submit" ...> or <input type="image" ...> . Even if <button>...</button> can be made to trigger the onsubmit directly in some browsers, it won't do so in others.

Is it possible my return true logic is correct? Here's what I've changes it to?