There are a number of ways to do this using Javascript.  On one site I
created a function like so:

function checkLength(chkField)
{
        if (chkField.value.length > 255)
                {
                        alert("This field cannot contain more than 255 characters!");
                        chkField.value = chkField.value.substring(0,255);
                        chkField.focus();
                        chkField.select();
                }
}

Then you can call this from the onBlur event for the textarea.

You could also parameterize the length, so the function can deal with any
figure, not just 255.

Bob


-----Original Message-----
From: Robert Everland [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 02, 2000 1:49 PM
To: CF-Talk
Cc: '[EMAIL PROTECTED]'
Subject: maxlength on text area


Is there a way to set a maxlength on a textarea using javascript or any
other method.

Robert Everland III
Web Developer
Dixon Ticonderoga
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to