Wednesday, October 14, 2009

Limiting Textarea length

I just wrote a java script to limit the max length of a teaxtarea control.
Here is the code snippet.

Limiting Textarea length


<'textarea name="txaDescription" onkeypress="return maxLength(this, 250);" textarea>

and the javascript

function imposeMaxLength(Object, MaxLen)
{
return (Object.value.length <= MaxLen);
}

0 comments:

My Achievements

Member of

Blog Archive

Followers

free counters