title: How to compare two text box values using jquery?
body: <p>I have two text boxes named txtbalance and txtdays. If I enter greater value in txtdays  than txtbalance I want  show error message. I have a javascript method but it not working.</p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;
  &lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
  $(document).ready(function () {
       $("#txtdays").on('input', function () {
           var txtbalance = $('#txtbalance').val();
           var txtdays = $('#txtdays').val();
  
           if (txtbalance === "" || txtdays === "") return false;
  
           if (parseInt(txtbalance) &lt; parseInt(txtdays)) {
               alert("u cant apply");
           }
       });
   });
  &lt;/script&gt;
  </code></pre>
  
  <p>And my sourse code</p>
  
  <pre><code>&lt;% Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master"  AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="drop._Default" %&gt;
  
  &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
  &lt;style type="text/css"&gt;
      .style1
      {
          width: 100%;
      }
      &lt;/style&gt;
  &lt;/asp:Content&gt;
   &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
   &lt;head&gt;
   &lt;script type="text/javascript" language="javascript"     src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
  $(document).ready(function () {
       $("#txtdays").on('input', function () {
           var txtbalance = $('#txtbalance').val();
           var txtdays = $('#txtdays').val();
  
           if (txtbalance === "" || txtdays === "") return false;
  
           if (parseInt(txtbalance) &lt; parseInt(txtdays)) {
               alert("u cant apply");
           }
       });
   });
  &lt;/script&gt;
  &lt;/head&gt;   
  &lt;table class="style1"&gt;
     &lt;tr&gt;
   &lt;asp:TextBox ID="txtbalance" runat="server"&gt;&lt;/asp:TextBox&gt;
   &lt;/tr&gt;
   &lt;tr&gt;
   &lt;asp:TextBox ID="txtdays" runat="server"&gt;&lt;/asp:TextBox&gt;
   &lt;/tr&gt;
   &lt;/asp:Content&gt;
  </code></pre>
  
  <p>please help me reach a solution...</p>