How to force javascript to run after the required validation control?
<p>I have a textbox that should not be empty, so I have placed a <strong>required validation control</strong> next to it. I have also a <strong>javascript confirmation box</strong> that asks the user is he's sure to submit the information.</p>

<p>The problem is that the Confirmation is appearing first, then the validation is kicking in after. I'd like to inverse that. I want the validation to proceed first. If there is no more error, then the user is asked if he's sure to submit the info.</p>

<h1>EDIT</h1>

<p>This the markup </p>

<pre><code>&lt;asp:LinkButton ID="_lnkAddUpdate" runat="server" CausesValidation="True" OnClientClick = "return ConfirmAddEdit(this.id)"
     CommandName="Update"&gt;&lt;/asp:LinkButton&gt;

&lt;asp:TextBox ID="_tbLocationName" runat="server" Text= '&lt;%# Eval("LocationName") %&gt;'/&gt;
&lt;asp:RequiredFieldValidator ID="reqLocationName" runat="server" ErrorMessage="Location name cannot be empty string." Text = "*" ControlToValidate = "_tbLocationName" /&gt;
</code></pre>

<p>This is the javascript</p>

<pre><code>function ConfirmActive(id) {
    var action = document.getElementById(id).innerHTML;
    var r = confirm("Are you sure you want to " + action + " this location?");
    if (r == false) {
        return false;
    }
}
</code></pre>

<p>Thanks for helping.</p>
