Below is the jQuery code I wrote to do it:
table is the id of a table that that all the textareas are a descendent of
cntOut is the id of a span I stick the count into.
jQuery('#table').on("blur keyup", "textarea",
function(e) {
var cnt = 0;
jQuery("textarea").each(
function(o) {
cnt += this.textLength;
});
jQuery(PrimeFaces.escapeClientId('#cntOut')).text(cnt);
});
No comments:
Post a Comment