I have a HTML form:

```
<form method="post" id="input_form" onSubmit="return save_mail();">
    <input type="text" value="enter your email" id="mail" name="mail"/>
    <button type="submit" id="save_btn" >Sign up</button>  
    <div id="warning"></div>
</form>

```

The javascript code looks like this:

```
function validateEmail(email) {
    var re = /\S+@\S+\.\S+/;
    return re.test(email);
}

function wrongEmail() {
    document.getElementById("warning").innerHTML="wrong email format";
}

function rightEmail() {
    document.getElementById("warning").innerHTML="";
}

function save_mail() {
    var pom=document.getElementById("mail").value;
    if (validateEmail(pom)) {
        $.post("php/sign_up.php", {mail : pom});
        rightEmail();
        alert("heey"); // if I remove this alert, it doesn't work on FF anymore
        return true;
    }
    else {
        wrongEmail();
        return false;
    }
}

```

It all works fine on Chrome and also Firefox, but if I remove the alert from my JS code, it doesn't work anymore. I don't know, how is this possible. There are no errors according to FF or Chrome.