Added max value in text area

This commit is contained in:
Lars van Hijfte
2017-01-31 15:16:40 +01:00
parent 44408ee429
commit 646e6dde48
4 changed files with 15 additions and 4 deletions

View File

@@ -93,4 +93,14 @@ function showGroups(groups, list) {
} else {
return false;
}
}
}
$(document).ready(function() {
$("body").delegate("textarea[maxlength]", "keydown", function() {
if ($(this).val().length / .9 >= $(this).attr("maxlength")) {
$(this).next().text($(this).val().length + "/" + $(this).attr("maxlength"));
} else {
$(this).next().text("");
}
});
});