Try this...
function validateLength(textareaElement) {
// your logic here, use textareaElement instead of $(this)
}
$('textarea[maxlength]').keyup(function(eventObject) {
window.setTimeout(function() {
validateLength($(eventObject.target));
, 1);
});
The timeout of 1 millisecond should be enough to "escape the inner scope" of the keyup event and allow you to get the correct string value of your textareaElement.