Hey all. I followed the guide in the "Professional Javascript for Web Developers" book to create a maxlength'd textarea, and it works. You can only put in a set number of characters. The problem comes when you've reached the limit and want to delete some of your characters. Apparently Javascript is picking up the delete/backspace key presses and blocking them.
So, my question is how to unblock those keys?
oh, and for those not familiar with the example, here's what I'm using:
Code:
var TextUtil = new Object();
TextUtil.isNotMax = function(oTextArea) {
return oTextArea.value.length != oTextArea.getAttribute("maxlength") - 1;
}
Which gets fired off onkeypress.