0

I'm wondering if there is an event, in Joomla 3.x with JCE editor, that will trigger when the text inside the editor box is being edited, when creating or editing an article. If there isn't an event (which I haven't found), how can I know when there is text being inserted?

Thank you!

0

I don't know if there is a specific event for this, however what you can do is use jQuery to detect a keyup event on the editor.

Firstly, inspect the edit element and get the class or ID. Then your jQuery could be something like this:

jQuery(document).ready_function($){
    $('textarea').on('keyup', function() {
       // do something here
    });
});

Update:

You can use the Joomla API to inject this jQuery, like so:

$doc = JFactory::getDocument();
$doc->addScriptDeclaration("
    jQuery(document).ready_function($){
        $('textarea').on('keyup', function() {
           // do something here
        });
    });
");
  • Thanks for the early reply. How can I insert this in the php file of my joomla plugin? – republicca Jul 2 '15 at 9:11
  • 1
    @republicca - See my update – Lodder Jul 2 '15 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.