function checkLength(textarea)
{
 var maxLength = 10;

 if (textarea.innerHTML.length > maxLength)
 {
  textarea.innerHTML = textarea.innerHTML.substring(0, maxLength);
 }
}

Do that onkeydown and onblur and it should be good enough?


>Does anybody have a really good way to create the equal of "maxlength" 
>on a text area? The server running site in question is only running CF 6 
>something, not 7, so cftextarea won't work...
>
>I've tried a couple of javascript ideas, and as long as you're typing 
>input, it works. But, everything I tried so far will allow pasting more 
>than the max set.
>
>I'm checking server side before the data insert, but the client wants to 
>see something client side while the form is being filled out.
>
>Ideas?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274322
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to