Answers.Body: <p>If you use the validateForm hook you can probably use the same code if you include both forms in your if-statement, like so:</p>
  
  <pre><code>if ($formName == "CRM_Contact_Form_Inline_Address" || $formName == "CRM_Contact_Form_Edit_Address") {
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-23T11:15:53.543Z
Answers.LastActivityDate: 2016-09-23T11:15:53.543Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>Recently we updated CiviCRM from 4.1 to 4.7 (yeah, we really need it). </p>
  
  <p>We have custom code in the pre and post hooks that validates some contact fields.</p>
  
  <p>Now, in the last version of CiviCRM, you can edit the fields inline, but we noticed that we have to duplicate our code if we want to edit inline.</p>
  
  <p>My question is, is there anyway to not duplicate the code for the inline edit? Is there some hook that triggers both the inline and the edit fields?</p>
  
Tags: <contacts>
Title: Edit contact inline
ThreadText: # Edit contact inline
  
  (Asked by: username_0 on 2016-09-23)
  
  Recently we updated CiviCRM from 4.1 to 4.7 (yeah, we really need it).
  
  We have custom code in the pre and post hooks that validates some contact fields.
  
  Now, in the last version of CiviCRM, you can edit the fields inline, but we noticed that we have to duplicate our code if we want to edit inline.
  
  My question is, is there anyway to not duplicate the code for the inline edit? Is there some hook that triggers both the inline and the edit fields?
  
  **Tags:** contacts
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-09-23. Score: 3 | Accepted answer
  
  If you use the validateForm hook you can probably use the same code if you include both forms in your if-statement, like so:
  if ($formName == "CRM_Contact_Form_Inline_Address" || $formName == "CRM_Contact_Form_Edit_Address") {
  
  
  ---
  
  