title: how to restrict the user to enter only 250 words in text area?
body: <p>i have created one form for user to submit a abstract. but while submitting i need to check weather they have added more than 250 words or not. i need to allow only 250 words . how to do this ?</p>
  
  <p>i have tried some JavaScript but it works for only 250 character. </p>
  
  <p>here is my code</p>
  
  <pre><code>function maxlength(element, maxvalue)
     {
    var q = eval("document.upload."+element+".value.length");
     var r = q - maxvalue;
     var msg = "Sorry, you have input "+q+" characters into the "+
    "text area box you just completed. It can return no more than "+
    maxvalue+" words to be processed. Please abbreviate "+
   "your text by at least "+r+" words";
      if (q &gt; maxvalue) alert(msg);
        }
  </code></pre>
  
  <p>and my textarea is :</p>
  
  <pre><code>  &lt;tr&gt;
     &lt;td&gt;&lt;label&gt;Abstract Details&lt;/label&gt; &lt;/td&gt;
   &lt;td&gt;&lt;label&gt;Please enter data, at most 250 words:&lt;/label&gt;
    &lt;br/&gt;&lt;textarea rows="6" cols="80"name="box_name"   onChange="maxlength('box_name', 250)" style="width: 257px; height: 131px;"&gt;    &lt;/textarea&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;tr&gt;
  </code></pre>
  
  <p>how to limit for 250 words .</p>
  
  <p>thanks in advance </p>