How to stop user sending form if confirmation email doesnt match with email?

I have a web to lead form, I have to confirm email with a second email input box. If two emails equals I will let user submit the form. If not I will alert user. But even though emails are not equals form keeps sending. Can you help with this?


**This is form tag**
<form id="theForm"  onsubmit="return validateForm()" action="https://webto.salesforce.com/bla bla bla" method="POST">



**This is my submit button**
<input type="submit"  name="submit" class="submit-button" onclick={alertUser()}  >


**and this is js**

var email=document.getElementById('email');
var confirmationEmail=document.getElementById('confirmationEmail');

function validateForm(event) {

    if (email.value != confirmationEmail.value)
    {
        alert('Emails don't match!');
        event.preventDefault();
        return false;
    } else {
        return true;
    }
  
}


I tried to add preventDefault() and return false;