0

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

    <field
        ...
        onchange="myCustomJavascriptFunction();"
    />

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

EDIT

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

    $document->addScript(JURI::root() . "/components/com_mycomponent"
                                      . "/views/myview/myCustomJavascriptFunction.js");
1
  • 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

0

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.