This commit is contained in:
nieguanghui 2013-12-28 10:57:56 +08:00
parent 398e35cf19
commit ed55fe0175
1 changed files with 5 additions and 2 deletions

View File

@ -23,10 +23,13 @@ function setMaxLength() {
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
alert(currentLength);
if (currentLength >= maxLength) {
this.relatedElement.className = 'toomuch';
else
}
else {
this.relatedElement.className = '';
}
this.relatedElement.firstChild.nodeValue = currentLength;
}