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 ?
i have tried some JavaScript but it works for only 250 character.
here is my 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 > maxvalue) alert(msg);
}
and my textarea is :
<tr>
<td><label>Abstract Details</label> </td>
<td><label>Please enter data, at most 250 words:</label>
<br/><textarea rows="6" cols="80"name="box_name" onChange="maxlength('box_name', 250)" style="width: 257px; height: 131px;"> </textarea></td>
</tr>
<tr>
how to limit for 250 words .
thanks in advance