Answers.Body: <p>You can solve this by writing some custom code in an extension. You can use a hook to insert this butoon on the contact form which does what you want to do. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-01T06:42:08.623Z
Answers.LastActivityDate: 2016-09-01T06:42:08.623Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.Body: <p>The way suggested by Jaap is correct. After creating a new extension in the buildForm hook I've inserted the following button:</p>
  
  <blockquote>
    <p>$form->add('submit', 'SaveAndContribution', ts('Save and Add
    Contribution'));</p>
  </blockquote>
  
  <p>and his template. The form is now complete.</p>
  
  <p>At the moment, anyway, I'm not able to distinguish which button was pressed. I had a look at the postProcess hook, but without result.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-06T12:21:12.220Z
Answers.LastActivityDate: 2016-09-06T12:21:12.220Z
Answers.UserDisplayName: marcello
Body: <p>In the contact form, I need to add a new button "Save and add Contribution" that, when pressed:</p>
  
  <ul>
  <li>save the current contact data</li>
  <li>redirect to the "New contribution" page, possibly with the contact already selected </li>
  </ul>
  
  <p>How can obtain this?
  Thanks</p>
  
Tags: <contacts><contributions>
Title: "Save contact and add contribution" button in the contact form
ThreadText: # "Save contact and add contribution" button in the contact form
  
  (Asked by: username_0 on 2016-08-31)
  
  In the contact form, I need to add a new button "Save and add Contribution" that, when pressed:
  
  * save the current contact data
  * redirect to the "New contribution" page, possibly with the contact already selected
  
  How can obtain this?
  Thanks
  
  **Tags:** contacts, contributions
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-09-01. Score: 1
  
  You can solve this by writing some custom code in an extension. You can use a hook to insert this butoon on the contact form which does what you want to do.
  
  
  ---
  
  ### Answer by username_0 on 2016-09-06. Score: 0
  
  The way suggested by Jaap is correct. After creating a new extension in the buildForm hook I've inserted the following button:
  
  > $form->add('submit', 'SaveAndContribution', ts('Save and Add
  > Contribution'));
  
  and his template. The form is now complete.
  
  At the moment, anyway, I'm not able to distinguish which button was pressed. I had a look at the postProcess hook, but without result.
  
  
  ---
  
  