Answers.Body: <p>You'll need to create an extension - see <a href="https://docs.civicrm.org/dev/en/latest/extensions/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/extensions/</a> to get started, and then you'll want to look at <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/</a> to add the checkbox and then <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/</a> to actually do something with it when the form is saved.</p>
  
  <p>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 <a href="https://docs.civicrm.org/dev/en/latest/framework/region/#region-reference" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/framework/region/#region-reference</a> to put it in the right place, or maybe insert some javascript there that also hides/shows your checkbox when the radio is clicked.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T19:08:23.170Z
Answers.Text: Thank you very much @demerit. you answer is really helpful to me
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:09:35.407Z
Answers.Text: my code is still not working. if i update my answer could you help me to resolve it?
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:12:41.457Z
Answers.Text: If there's a specific problem then maybe, but usually back-and-forth detailed help works best if you go https://chat.civicrm.org and ask in the `dev` or `user-support` channel. Also stackexchange is terrible about update notifications.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:21:32.320Z
Answers.Text: ok thanks. i want to know can we call the civicrm_buildForm() function in different names on a same file ?
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:25:18.663Z
Answers.Text: I'm not sure I understand - do you mean use one single buildForm() function to change two different pages in civi? You can use $formName to decide what to do inside the function. $formName will be different depending on what page you visit in civi.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:32:38.113Z
Answers.Text: no actually i asked to use two buildForm() in one file to change one page content in civi. mean i want to display two check boxes in the message template. so i'm trying the define the check box using two different buildForm functions in same php file. the first function is working but the second function is not.
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:39:15.263Z
Answers.Text: Ok. You don't need a second buildForm(), you can just call `$form->add()` twice in the one buildForm() function.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T20:48:07.293Z
Answers.Text: thank you! you really helped me to understand the concept behind this. Thank you very much!
Answers.UserDisplayName: safron
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-10T18:44:58.470Z
Answers.LastActivityDate: 2020-06-10T18:44:58.470Z
Answers.UserDisplayName: Demerit
Body: <p>I want to display a checkbox when the user clicks upload documents in message template. How should i do it?  </p>
  
Tags: <message-templates>
Title: How do i add a new checkbox in message template
ThreadText: # How do i add a new checkbox in message template
  
  (Asked by: username_0 on 2020-06-10)
  
  I want to display a checkbox when the user clicks upload documents in message template. How should i do it?
  
  **Tags:** message-templates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-10. Score: 0 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: Thank you very much @demerit. you answer is really helpful to me  
  > **username_0**: my code is still not working. if i update my answer could you help me to resolve it?  
  > **username_1**: If there's a specific problem then maybe, but usually back-and-forth detailed help works best if you go https://chat.civicrm.org and ask in the `dev` or `user-support` channel. Also stackexchange is terrible about update notifications.  
  > **username_0**: ok thanks. i want to know can we call the civicrm_buildForm() function in different names on a same file ?  
  > **username_1**: I'm not sure I understand - do you mean use one single buildForm() function to change two different pages in civi? You can use $formName to decide what to do inside the function. $formName will be different depending on what page you visit in civi.  
  > **username_0**: no actually i asked to use two buildForm() in one file to change one page content in civi. mean i want to display two check boxes in the message template. so i'm trying the define the check box using two different buildForm functions in same php file. the first function is working but the second function is not.  
  > **username_1**: Ok. You don't need a second buildForm(), you can just call `$form->add()` twice in the one buildForm() function.  
  > **username_0**: thank you! you really helped me to understand the concept behind this. Thank you very much!  
  
  ---
  
  