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!

1 Answer 1

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
        });
    });
");
2
  • Thanks for the early reply. How can I insert this in the php file of my joomla plugin?
    – republicca
    Commented Jul 2, 2015 at 9:11
  • 1
    @republicca - See my update
    – Lodder
    Commented Jul 2, 2015 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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