1

I want to display a checkbox when the user clicks upload documents in message template. How should i do it?

1 Answer 1

0

You'll need to create an extension - see https://docs.civicrm.org/dev/en/latest/extensions/ to get started, and then you'll want to look at https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/ to add the checkbox and then https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/ to actually do something with it when the form is saved.

But also because the upload documents section is in a hidden section until you click the radio, if you want to add the checkbox in the same section you'll also need to look at https://docs.civicrm.org/dev/en/latest/framework/region/#region-reference to put it in the right place, or maybe insert some javascript there that also hides/shows your checkbox when the radio is clicked.

8
  • Thank you very much @demerit. you answer is really helpful to me
    – safron
    Jun 10, 2020 at 19:08
  • my code is still not working. if i update my answer could you help me to resolve it?
    – safron
    Jun 10, 2020 at 20:09
  • If there's a specific problem then maybe, but usually back-and-forth detailed help works best if you go chat.civicrm.org and ask in the dev or user-support channel. Also stackexchange is terrible about update notifications.
    – Demerit
    Jun 10, 2020 at 20:12
  • ok thanks. i want to know can we call the civicrm_buildForm() function in different names on a same file ?
    – safron
    Jun 10, 2020 at 20:21
  • 1
    thank you! you really helped me to understand the concept behind this. Thank you very much!
    – safron
    Jun 10, 2020 at 20:48

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.