Answers.Body: <p><a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/" rel="nofollow noreferrer"><code>buildForm</code></a> hook is used to add the elements on the form. To store the values of your select element, you need to look at <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/" rel="nofollow noreferrer"><code>postProcess</code></a> hook which is called after the form is submitted.</p>
  
  <p>You'll get the submitted select value in <code>$form</code> parameter. Use this and store the value in your expected table.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-27T04:10:07.100Z
Answers.LastActivityDate: 2018-03-27T04:10:07.100Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>As Jitendra explained you can use the <code>postProcess</code> hook and the <code>$form</code> parameter. The submitted values will be in an array <code>$form-&gt;_submitValues</code>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-27T07:09:04.583Z
Answers.LastActivityDate: 2018-03-27T07:09:04.583Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I figured out how to add form fields using the buildForm hook.  I am adding a select element to a participant profile on an event registration form.  Do the values from the added fields get saved when the user submits the form?  If so, where can I see them?  If not, how do I store them with the other profile info using code?  The custom fields feature does not work (DB Error: Already exists)  right now or else I would use that.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-27T14:14:35.327Z
Comments.Text: You might want to ask a separate question about fixing your custom fields issue!  There is a lot of capability built in for custom fields that is not there for your own manual fields.
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-27T15:54:26.063Z
Comments.Text: @Aidan I have just posted a question on how to solve my custom fields issue.  It can be found at [link](https://civicrm.stackexchange.com/questions/24281/custom-field-set-creation-yields-duplicate-entry-0-for-key-primary)  Would you mind taking a look?
Comments.UserDisplayName: ermSO
Tags: <joomla><php><forms><quickform>
Title: Adding and storing form fields
ThreadText: # Adding and storing form fields
  
  (Asked by: username_0 on 2018-03-27)
  
  I figured out how to add form fields using the buildForm hook. I am adding a select element to a participant profile on an event registration form. Do the values from the added fields get saved when the user submits the form? If so, where can I see them? If not, how do I store them with the other profile info using code? The custom fields feature does not work (DB Error: Already exists) right now or else I would use that.
  
  **Tags:** joomla, php, forms, quickform
  
  > **Comments:**
  > **username_1**: You might want to ask a separate question about fixing your custom fields issue!  There is a lot of capability built in for custom fields that is not there for your own manual fields.  
  > **username_0**: @username_1 I have just posted a question on how to solve my custom fields issue.  It can be found at [link](https://civicrm.stackexchange.com/questions/24281/custom-field-set-creation-yields-duplicate-entry-0-for-key-primary)  Would you mind taking a look?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-03-27. Score: 2
  
  [`buildForm`](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/) hook is used to add the elements on the form. To store the values of your select element, you need to look at [`postProcess`](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/) hook which is called after the form is submitted.
  
  You'll get the submitted select value in `$form` parameter. Use this and store the value in your expected table.
  
  
  ---
  
  ### Answer by username_3 on 2018-03-27. Score: 0
  
  As username_2 explained you can use the `postProcess` hook and the `$form` parameter. The submitted values will be in an array `$form->_submitValues`.
  
  
  ---
  
  