title: onclientclick validation not working
body: <p>The submit button should validate all the txtboxes, so i have written this code,<br>
  but  it is not working
  and <strong>I also want that if textboxes aren't empty, then it should postback and onclick should call, otherwise not</strong>  </p>
  
  <pre><code> function submit() {
        for( var i = 0, t = document.getElementsByName( "txt" ), l = t.length; i &lt; l; i++ )     
           if( t[i].value)
              return true;
  
        return false;
     }
  </code></pre>
  
  <p><strong>.aspx</strong></p>
  
  <pre><code>&lt;asp:TextBox name="txt" runat="server" ID="email" CausesValidation="True"
                            ClientIDMode="Static"  ValidationGroup="email" &gt;&lt;/asp:TextBox&gt;
  
   &lt;b&gt;Password:&lt;/b&gt;&lt;br /&gt;
                          &lt;asp:TextBox ClientIDMode="Static" ID="pwd" runat="server" name="txt" TextMode="Password" CausesValidation="True"&gt;&lt;/asp:TextBox&gt;
  
   &lt;asp:LinkButton ID="Submit" runat="server" CssClass="button" Text="Login"
                               onclick="Submit_Click" OnClientClick="submit()" CausesValidation="False" /&gt;
  </code></pre>