JavaScript form submit doesn't fire asp server-side click function of the submit button
<p>I used an event listener to prevent the action of my asp:button (submit) because I wanted to validate my form with a javascript function before it actually gets submitted.</p>

<pre><code>formInstance.addEventListener('submit', function (event) {
    event.preventDefault(); 
}, false);
</code></pre>

<p>Here is the button:</p>

<pre><code>&lt;asp:Button ID="btnCreateForm" CssClass="submit-form button" runat="server" 
    Text="Save Form" OnClick="btnCreateForm_Click" 
        OnClientClick="Sharpforms.checkFormEntry()" /&gt;
</code></pre>

<p>The fired javascript:</p>

<pre><code>checkFormEntry: function () {
    var formName = document.getElementById("txtFormName");

    if (formName.value.trim() == "") {
        alert("Please fill in a valid form name!");
        return false;
    }
    else {
        //formInstance.submit();
        return true;
    }
}
</code></pre>

<p>Apparently the javascript submit() does submit the form because the page is being reloaded but I recognized that it doesn't enter my ASP side <strong>btnCreateForm_Click</strong> function any more:</p>

<pre><code>protected void btnCreateForm_Click(object sender, EventArgs e)
{
    System.Diagnostics.Debug.WriteLine("Test if the button has been clicked.");
}
</code></pre>

<p>When commenting my form event listener as well as the submit() and try to submit it natively he enters the click function without problems. But then I have no possibility to check my form on the client side. What am I missing?</p>
