Open a new window/tab
<p>I am working on a donations website.  In my page, I have a textbox which accepts a numeric value from the user (that is, money to be donated).</p>

<p>In my code-behind, I have a method which checks whether the value in the textbox is numeric.  The method generates an error message if the number is invalid.</p>

<p>I also have a JavaScript which, after checking that the value in the textbox is numeric, opens a new tab to the website confirmation page, thanking the user for his donation.  Here is the code of the javascript:</p>

<pre><code>&lt;script type="text/javascript"&gt;
        function Open_Window()
        {
            var textbox = document.getElementById('DonationTextBox');

            if (textbox.value != "")
            {
                if (isNan(textbox) == false)
                {
                    window.open("DonationConfirmation.aspx")
                }
            }
        }
    &lt;/script&gt;
</code></pre>

<p>The problem is that the tab is NEVER opened, even if the number is valid.  Can you please help me solve this problem?  Thank you.</p>

<p>P.S.</p>

<p>Here is the code of the button that initiates the validation:</p>

<pre><code>&lt;asp:ImageButton ID="PayPalButton2" runat="server" ImageAlign="Middle" 
                                        ImageUrl="Resources/Icons/PayPalCheckOut.gif" 
                                        onclick="PayPalButton2_Click" OnClientClick="Open_Window()"/&gt;
</code></pre>
