Validators not working in asp.net
<p>I need to use 2 validations for the same textbox(which accepts an academic year name for the input):</p>

<ol>
<li><p>Regular expression validator to allow name to be entered only in format <strong>YYYY-YY</strong>. I have got this working :</p>

<pre><code>&lt;asp:RegularExpressionValidator id="txtAcademicYearName_RegularExpressionValidator2" runat="server" ControlToValidate="txtAcademicYearName" ErrorMessage="Enter academic year name in format YYYY-YY" ValidationExpression="(\b19|\b20)\d\d-\d\d" ForeColor="Red" Display="None"  ValidationGroup="AcademicYear"&gt;&lt;/asp:RegularExpressionValidator&gt;
</code></pre></li>
<li><p>When the user enters the year name, the to value should obviously be greater than the from value( Eg. 2012-13 is correct, but 2013-12 is wrong). I have added a client validation function for this:</p>

<pre><code>  function checkAcademicYear(source, args) {
  alert("yeah");
  var sAcadYearName = document.getElementById('&lt;%= txtAcademicYearName.ClientID%&gt;').value;
  var year = new Array;
  year = sAcadYearName.split("-");
  var yearStart = year[0];
  var yearEnd = year[1];

  var checkYearStart = (sAcadYearName.charAt(2) + sAcadYearName.charAt(3));

  if (yearEnd &lt;= checkYearStart) {
      arguments.IsValid = false;

  }
  else {
      arguments.IsValid = true;

  }
</code></pre>

<p>}</p></li>
</ol>

<p><strong>AcademicYear</strong> is a popup which opens on a button click. Now when I enter name in textbox as some string, it opens the popup(it should not do) but I can see the regular expression validator's error message in the popup.</p>

<p>How do I get both the conditions working?</p>
