title: How to ensure a disable button when number of characters exceed 160
body: <p>i have a script that tells my button to go disable mode when number of characters go beyond 160 but it is not working. any idea why?</p>
  
  <p>this is my javascript:</p>
  
  <pre><code>     &lt;script&gt;
     function CountLeft(field,max){
         //disable post
         if (field.value.length &gt; max)
            $('#workroom_submit').attr("disable","disable");
         // enable post 
         if (field.value.length &lt;= max)
            $('#workroom_submit').attr("disable","");
         }
      &lt;/script&gt;
  </code></pre>
  
  <p>this is my html:</p>
  
  <pre><code>  &lt;textarea cols="50" rows="3" name="postMsg"  onKeyDown="CountLeft(this.form.text,160);" onKeyUp="CountLeft(this.form.text,160);"&gt;&lt;/textarea&gt;
  
    &lt;input type="submit" name="workroom_submit" id="workroom_submit" disable="" value="Post" onclick="updateMsg()"/&gt;
  </code></pre>