Bleiben Sie auf der aktuellen Seite, wenn die Formularüberprüfung falsch ist

Ich möchte auf der aktuellen Seite bleiben, wenn das Eingabefeld "Name" leer ist. Momentan wird die Fehlermeldung angezeigt und wenn Sie auf OK klicken, wird immer noch die nächste Seite (contactcaptcha.php) aufgerufen.

function notEmpty(elem, helperMsg){
 if(elem.value.length == 0){
    alert(helperMsg);
    elem.focus();
    return false;

 }
 return true;
}




<form id="action" action="contactcaptcha.php" method="post">
    <fieldset>

      <textarea id="message" name="Message" placeholder="What's on your mind?"></textarea>

      <input id="Name" name="Name"  placeholder="Enter your full name" type="text">

      <input id="Email" name="Email" placeholder="Enter your email address" type="email">

      <input type="submit" onclick="notEmpty(document.getElementById('Name'), 'Please enter your name')" name="submit" value="Send your message">

    </fieldset>

Antworten auf die Frage(3)

Ihre Antwort auf die Frage