florida1987
IS-IT--Management
- Dec 9, 2007
- 26
For a textarea how do I limit the number of characters in the box to 500?
For input text I can set to maxlength and limit the entry in the input: <INPUT TYPE=TEXT NAME="myInfo" MAXLENGTH=500>
For textarea I assume I need to create a validation or something to fetch the length of the field and stop the entry after 500 characters. Please advise how this can be done.
For input text I can set to maxlength and limit the entry in the input: <INPUT TYPE=TEXT NAME="myInfo" MAXLENGTH=500>
For textarea I assume I need to create a validation or something to fetch the length of the field and stop the entry after 500 characters. Please advise how this can be done.
Code:
if(form.myInfo.value.length() > 500)
{
//how would I stop the length in the textarea here?
}