Answers.Body: <p>There isn't a way to do this in the user interface but you can write a small extension where you either:</p>
  <ul>
  <li>Use <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> and change the field definition so that it's required.</li>
  <li>Use <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/</a> and set an error if the field is blank.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-04T19:09:15.130Z
Answers.LastActivityDate: 2021-03-04T19:09:15.130Z
Answers.UserDisplayName: Demerit
Body: <p>When i add a new contribution to a contact, i would like to avoid an empty &quot;Source&quot; field.</p>
  <p>I need it to be *required.</p>
  <p>Have anyone already done this ?</p>
  <p>thanks</p>
  
Tags: <contributions><forms>
Title: How do i force a field to be required
ThreadText: # How do i force a field to be required
  
  (Asked by: username_0 on 2021-03-04)
  
  When i add a new contribution to a contact, i would like to avoid an empty "Source" field.
  
  I need it to be \*required.
  
  Have anyone already done this ?
  
  thanks
  
  **Tags:** contributions, forms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-04. Score: 1
  
  There isn't a way to do this in the user interface but you can write a small extension where you either:
  
  * Use <https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/> and change the field definition so that it's required.
  * Use <https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/> and set an error if the field is blank.
  
  
  ---
  
  