0

I working on a simple module that have a simple backend form composed with custom field and I looking for a event or something else to process something during it submition.

What's the way to to do something when i click save from my admin form of this module?

Thanks in advance :)


Edit: I looking for how to do something specific when the save button of the module is clicked. In this case, I have a image upload field and when i click on the save button, I want to create thumbnails from this image. And only at this time.

I have look to add a field hidden like is_submit to do something if this POST value is submit but if this value is write in the database and loaded all times with the module, I'm not sure the form is really submit by the user...

If someone have a idea to do this simply (without ajax if possible). ;)

3
  • So, you have a module with a field that gets filled in from the Module Manager in the admin and you want to save the contents of that field to the database and show the contents of the field in the front-end of the website in a module position? Dec 28, 2018 at 19:25
  • For the record, this question was started on Gitter and transferred here (thanks Sebastien) gitter.im/joomla/joomla-cms?at=5c24a21f09b8066849703bb7 There was a little bit of dialogue that didn't quite makes its way over here. Dec 28, 2018 at 22:15
  • @Michalel Yaeger: No I want to execute a specific action if the form is submit. I have some difficulties to understand how to do something when the form is submit. Like working on a field value... In this case i have a field to upload an image and when it's submit i want to create thumbnails and this only when the form is submitted
    – Sebastien
    Dec 29, 2018 at 7:28

1 Answer 1

1

You can submit the data by ajax or by regular post.

If the 'target' is not a regular component controller, but a custom action, then you can use joomla com_ajax interface so that the module post the data to it's own handler. see: https://docs.joomla.org/Using_Joomla_Ajax_Interface#Module_Support and here an example of such module: https://github.com/Joomla-Ajax-Interface/Ajax-Session-Module

Your Answer

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

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