In a form field of a custom component, I want to specify a javascript function for an onchange event like this:


Where I should put my myCustomJavascriptFunction and how to specify it to Joomla so that it is executed on the change event?


The usual way of declare it in the view doesn't work:

    $document->addScript(JURI::root() . "/components/com_mycomponent"
                                      . "/views/myview/myCustomJavascriptFunction.js");
  • I want to upvote your question. Can you please edit your question to show at least one attempt to self-solve and/or one online resource indicating that you researched before asking?
    – mickmackusa
    Dec 6, 2021 at 0:04


Your Answer

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

Browse other questions tagged or ask your own question.