Hi, i'm looking to limit the number of words entered into the ckeditor. So far i have a simple way of counting the number of words, and updating a counter. But now i need to do something when the limit is reached, like remove the last word/letter entered, or prevent any more characters being entered:
CKEDITOR.on("instanceReady", function(e)
{
var counterVal = Number($('.countdown-val').text());
e.editor.on('change', function () {
var newVal = counterVal - $(e.editor.getData()).text().split(/\s/).length;
$('.countdown-val').text(newVal);
if(newVal<0) return false; // prevent keystroke here, unless it's delete
});
});
