title: Disable submit button if value less than specified
body: <p>I'm trying to disable the submit button if the form total is less than $200.
  I've hacked together some code but can't get it to work.</p>
  
  <p>(total1) comes from another script.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function () {      
        if ($('total1').val() &gt; 200)
            $(this).closest("form").find(":submit").removeAttr("disabled");
        else
            $(this).closest("form").find(":submit").attr("disabled", "disabled");      
        }
  &lt;/script&gt;
  
  &lt;form method="post" action="order.php"&gt;
  Order total = $&lt;input style="border: 0px solid #000000;" size="3" type="text" id="total1" readonly /&gt;
  &lt;input type="submit" value="Submit" disabled title="Order is below $200 minimum."&gt;
  </code></pre>