-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create textarea character countdown #11
Comments
CKEditor has no build-in character limit, like the Have to consider how markup relates to character count. If not included, which is more sensible, then the HTML has to be stripped out in order to ensure a proper plain text count (maximum of 1000 characters, as determined by Success Criteria). Then you're betting that there's no combination of markup that CKEditor would create that would push the character count beyond the database limit (4000 characters). |
http://stackoverflow.com/a/27720326 window.onload = function() {
CKEDITOR.instances.mytext.on( 'key', function() {
var str = CKEDITOR.instances.mytext.getData();
if (str.length > 50) {
CKEDITOR.instances.mytext.setData(str.substring(0, 50));
}
} );
}; |
Something like:
The text was updated successfully, but these errors were encountered: