jquery each function not working on client click asp.net
<pre><code>function AddressVal5() {
   $('.ma-addressEdit .address:visible input:text.number').each(function () {
      var maxLength = $(this).attr('maxLength');
      var thisLength = $(this).val().length;
      //  alert(maxLength + ' ' + thisLength)
      //$(this).next('.error').hide();
      if ($(this).val() == '' || thisLength &lt; maxLength) {
         alert("sa");
         $(this).next('.error').show();
         return false;
      }
   });

   $('.ma-addressEdit .address:visible input:text, .ma-addressEdit .address:visible textarea').each(function () {
      var maxLength = $(this).attr('maxLength');
      var thisLength = $(this).val().length;
      $(this).next('.error').hide();
      if ($(this).val() == '' || thisLength &lt; maxLength) {
         $(this).next('.error').show();
      }
   });

} 
</code></pre>

<p>I am working on jquery validations its work properly with</p>

<pre><code>&lt;a href="javascript:void(0);" class="clear" id="addressUpdateBtn"&gt;&lt;img src="images/update.png" width="83" height="31" alt="Upate" onclick="AddressVal5()" /&gt;&lt;/a&gt;                                    
</code></pre>

<p>but not work with</p>

<pre><code>&lt;asp:ImageButton ID="imgbtnNewADD" runat="server"
                                ImageUrl="~/_layouts/images/Experia/update.png" CssClass="Nbutton" OnClientClick="return AddressVal5();" ToolTip="Add" OnClick="imgbtnNewADD_Click" /&gt;
</code></pre>

<p>error messages are come but refresh on click please help..</p>
