Answers.Body: <p>Are you changing it to the "value" or the "label" for the dropdown options? It should be the "value" (as defined when you set up the multiple choice options for the field). Or you can look in the generated html which might look like this <code>&lt;option value="1"&gt;Yes&lt;/option&gt;</code>, and then you'd use "1", not "Yes". It's the select tag you want to update not the associated input tag (well, yes the input tag too, but it only matters for the display on-screen).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-29T19:18:09.470Z
Answers.LastActivityDate: 2016-03-29T19:18:09.470Z
Answers.UserDisplayName: Demerit
Body: <p>I have been charged with developing CivicCrm for my place of business.</p>
  
  <p>The company I work for is a nonprofit and we help people with disabilities both mental and physical. The Department that deals with seniors needs to produce reports to certain agencies. As part of the reporting, a matrix must be filled out – This is a questionnaire.</p>
  
  <p>I currently have all of the question fields created in sections/tabs under CivicCase. The matrix is grouped by questions.  For example a section entitled Income will have 4-5 questions based on Income. Depending on the yes or no answers a final field (#6) will need to be automatically populated. For example the questions are:</p>
  
  <ol>
  <li>Does the household have income (both earned income and cash benefits)?</li>
  <li>Is the household's income greater than or equal to 200% of Federal Poverty Guidelines?</li>
  <li>Does the household show appropriate spending habits (Focus on meeting basic needs before purchasing luxuries, no unusually high costs, no spontaneous or inappropriate spending)</li>
  <li>Does the household need assistance (Outside of own income) to meet basic needs?</li>
  <li>Does the household have discretionary income and the ability to save?</li>
  <li>Score: </li>
  </ol>
  
  <p>So if 1 is answered yes you would continue to 2. If 2 were answered yes you would continue to 3.  If 3 was “no” then a score would need to be recorded in field #6 above and no further questions would be needed and the rest would need to be changed to no. There will be several sections that will be about employment, Housing, etc. that would need to be scored similarly. </p>
  
  <p>I have currently been able to use JavaScript to change the fields but when saved the incorrect value is saved in the database. I am using 2 answer dropdown selections. </p>
  
  <p>I know this is probably something simple I am missing. What value should I be changing for it to save to the database?</p>
  
  <p>CivicCRM version:  4.7.4
  Drupal: 7.43</p>
  
  <p>I am not using anything other than a custom jQuery script that I am including in the head of the document using the Drupal template.php file.</p>
  
  <p>Thank you
  C Tyler</p>
  
Tags: <custom-fields><civicase><javascript>
Title: Updating Custom Form Value via jQuery not Saving to Database
ThreadText: # Updating Custom Form Value via jQuery not Saving to Database
  
  (Asked by: username_0 on 2016-03-29)
  
  I have been charged with developing CivicCrm for my place of business.
  
  The company I work for is a nonprofit and we help people with disabilities both mental and physical. The Department that deals with seniors needs to produce reports to certain agencies. As part of the reporting, a matrix must be filled out – This is a questionnaire.
  
  I currently have all of the question fields created in sections/tabs under CivicCase. The matrix is grouped by questions. For example a section entitled Income will have 4-5 questions based on Income. Depending on the yes or no answers a final field (#6) will need to be automatically populated. For example the questions are:
  
  1. Does the household have income (both earned income and cash benefits)?
  2. Is the household's income greater than or equal to 200% of Federal Poverty Guidelines?
  3. Does the household show appropriate spending habits (Focus on meeting basic needs before purchasing luxuries, no unusually high costs, no spontaneous or inappropriate spending)
  4. Does the household need assistance (Outside of own income) to meet basic needs?
  5. Does the household have discretionary income and the ability to save?
  6. Score:
  
  So if 1 is answered yes you would continue to 2. If 2 were answered yes you would continue to 3. If 3 was “no” then a score would need to be recorded in field #6 above and no further questions would be needed and the rest would need to be changed to no. There will be several sections that will be about employment, Housing, etc. that would need to be scored similarly.
  
  I have currently been able to use JavaScript to change the fields but when saved the incorrect value is saved in the database. I am using 2 answer dropdown selections.
  
  I know this is probably something simple I am missing. What value should I be changing for it to save to the database?
  
  CivicCRM version: 4.7.4
  Drupal: 7.43
  
  I am not using anything other than a custom jQuery script that I am including in the head of the document using the Drupal template.php file.
  
  Thank you
  C Tyler
  
  **Tags:** custom-fields, civicase, javascript
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-03-29. Score: 1 | Accepted answer
  
  Are you changing it to the "value" or the "label" for the dropdown options? It should be the "value" (as defined when you set up the multiple choice options for the field). Or you can look in the generated html which might look like this `Yes`, and then you'd use "1", not "Yes". It's the select tag you want to update not the associated input tag (well, yes the input tag too, but it only matters for the display on-screen).
  
  
  ---
  
  