I have been facing a problem when I try to update the article from the frontend then it shows this error

Joomla.submitbutton is not a function at HTMLButtonElement.onclick

Here is my code

<div class="btn-group">
            <button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('article.save')">
                <span class="icon-ok"></span><?php echo JText::_('JSAVE') ?>


I am also facing this error

Uncaught TypeError: Joomla.getOptions is not a function

Which if I go to the source code I find this script

    headers: {
        'X-CSRF-Token': Joomla.getOptions('csrf.token')

And that script is not visible in the actual file

  • Is this an issue you're having with Joomla core, a 3rd party extension or your own code? – Lodder Jan 8 at 8:15
  • @Lodder core joomla – Zain Farooq Jan 8 at 8:20
  • And are you using the latest version of Joomla? – Lodder Jan 8 at 8:23
  • Yes joomla version is 3.9.1 – Zain Farooq Jan 8 at 8:26
  • It looks like that Joomla javascript library is not loaded somehow on the page. That's the only thing I can imagine in this case, if this is inside a core Joomla function of a core component. Thus the above mentioned functions cannot be recognized as functions. Or it could be a javascript conflict with another javascript library. – Zollie Jan 8 at 18:08

I have found the solution. I have removed the javascript like onclick="Joomla.submitbutton('article.save')" from the form view of com_content and added the necessary php code to make form submit to the right direction. Now the form is working fine

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.