JavaScript Postback on condition
<p>I need help with the javascript below please. I have 2 text boxes and 1 button on my form. What I would like to happen is if User enters a value in textbox one and not textbox two, then event need not be fired. However, if there is a value in textbox one and then textbox 2 then I want a post back to fire. My code below does not seem to be doing this at all and I would appreciate it if someone could help me fix this or better still figure it out. Thanks in advance</p>

<pre><code>function Changed(textControl) {
    //  alert(textControl.value);
    var conlength = document.getElementById('&lt;%=txtLength.ClientID %&gt;');
    var conwidth = document.getElementById('&lt;%=txtwidth.ClientID %&gt;');
    if (conlength != null &amp;&amp; conwidth != null) {
        if (conlength.value != null &amp;&amp; conlength.value != ' ' &amp;&amp; conwidth.value != null &amp;&amp; conwidth.value != ' ') {
            // ' ' corresponds to c#'s String.Empty                
            __doPostBack(document.getElementById('&lt;%=btncalcboardfeet.ClientID %&gt;'), 'Calculate Board Feet Button event has been fired');
        }
    }
}
</code></pre>
