How to limit characters in JFactory::getEditor - Joomla
Pergunta
$editor = & JFactory::getEditor();
$params = array('smilies'=> '0' ,'style' => '0' ,'layer' => '0' ,'table' => '0' ,'clear_entities'=>'0');
$editor->display('description', $description , 550, 400, 60, 20, false, $params);
I use above code to generate a WYSIWYG editor in Joomla. Is there are way to limit character you enter in the editor?
Thanks
Solução
In order to limit the number of characters in an wysiwyg editor you will have to take into account that you may count the visible characters only or to count all characters (html overhead too). For tinymce there is a decription of the developers on how to count and limit characters/words (on submit): http://www.tinymce.com/wiki.php/How_to_limit_number_of_characters/words
If you want to limit the insertion of characters you will need to write an own plugin or configure your tinymce with some special functionality (functions). Here are some helpfull ressources to get you started:
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow