title: javascript if number greater than number
body: <p>I have this javascript function to validate if a number is greater than another number</p>
  
  <pre><code>function validateForm() {
      var x = document.forms["frmOrder"]["txtTotal"].value;
      var y = document.forms["frmOrder"]["totalpoints"].value;
  
      if (x &gt; y) {
          alert("Sorry, you don't have enough points");
          return false;
      }
  }
  </code></pre>
  
  <p>It's not working for some reason. </p>
  
  <p>If I do <code>alert(x)</code> I get 1300, and <code>alert(y)</code> gives 999</p>
  
  <p>This works....</p>
  
  <pre><code>function validateForm() {
      var x = 1300;
      var y = 999;
  
      if (x &gt; y) {
          alert("Sorry, you don't have enough points");
          return false;
      }
  }
  </code></pre>