title: 0x800a138f - JavaScript runtime error: Unable to get property 'value' of undefined or null reference
body: <p>i have written a javascript code to compare 2dates from 2 textboxes</p>
  
  <pre><code>     function CompareDates() {
              var fdate = document.getElementById('txtFromDate');
              var edate = document.getElementById('txtToDate');
              var FromDate = fdate.value.split('/');
              var EndDate = edate.value.split('/');
              var val = 'false';
  
              if (parseInt(FromDate[2]) &lt; parseInt(EndDate[2])) {
                  val = 'true';
                  return true;
              }
              else if (parseInt(FromDate[2]) == parseInt(EndDate[2])) {
                  if (parseInt(FromDate[0]) &lt; parseInt(EndDate[0])) {
                      val = 'true';
                      return true;
                  }
                  else if (parseInt(FromDate[0]) == parseInt(EndDate[0])) {
                      if (parseInt(FromDate[1]) &lt;= parseInt(EndDate[1])) {
                          val = 'true';
                          return true;
                      }
                  }
              }
              if (val == "false") {
                  alert("FromDate Always Less Than ToDate");
                  return false;
              }
          }
  </code></pre>
  
  <p>and html code is</p>
  
  <pre><code>     &lt;asp:TextBox ID="txtFromDate" runat="server" Width="150px" /&gt;
       &lt;ajaxToolkit:CalendarExtender CssClass="MyCalendar" runat="server"
                                     ID="ceFromDate"
                                     TargetControlID="txtFromDate"
                                     Format="dd/MM/yyyy" /&gt;
      &lt;asp:TextBox ID="txtToDate" runat="server" Width="150px" /&gt;
      &lt;ajaxToolkit:CalendarExtender CssClass="MyCalendar" runat="server" 
                                    ID="ceToDAte"
                                    TargetControlID="txtToDate"
                                    Format="dd/MM/yyyy" /&gt;
  
       &lt;asp:Button ID="btnGenerate" runat="server" CssClass="button"
                   Text="Generate" OnClientClick="if(!CompareDates()) return false;" 
                   OnClick="btnGenerate_Click" /&gt;
  </code></pre>
  
  <p>the problem is that the page is running well in chrome but when i run my application in IE it throw an error </p>
  
  <blockquote>
    <p>0x800a138f - JavaScript runtime error: Unable to get property 'value'
    of undefined or null reference</p>
  </blockquote>
  
  <p>please help me to overcome from this problem.</p>