Title: Multiple values per Dropdown selection
Last modified: February 14, 2017

---

# Multiple values per Dropdown selection

 *  Resolved [alphi](https://wordpress.org/support/users/alphi/)
 * (@alphi)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-values-per-dropdown-selection/)
 * Hi!
 * The first field in my form is a dropdown in which you select your country. Depending
   on the choice, a specific value is passed to an equation in a Calculated Field.
   This works perfectly …. BUT …. I have another Calculated Field to which I want
   to pass another value (again dependent on the country selected). How can I do
   this without having to use two dropdown fields?
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-values-per-dropdown-selection/#post-8803457)
 * Hello,
 * I’m sorry, but I’m not sure about your question.
 * Assuming that a country represents a value for a calculated field and another
   value for another calculated field, an alternative would be define a global javascript
   object with countries and properties, and use the corresponding property depending
   on the equation:
 * – Insert a the DropDown field (the fieldname1) with the choices:
 * First choice:
    Text: United State Value: US
 * Second Choice:
    Text: United Kingdom Value: UK
 * Third Choice:
    Text: Spain Value: SP
 * – Insert a “HTML Content” field (the fieldname2) to define the global object,
   similar to:
 *     ```
       <script>
       db = {
       'US':{'property_a': 56, 'property_b': 38},
       'UK':{'property_a': 12, 'property_b': 86},
       'US':{'property_a': 67, 'property_b': 53}
       };
       </script>
       ```
   
 * – Now in the first equation use the “property_a”:
 *     ```
       (function(){
       var value = db[fieldname1]['property_a'];
   
       /** the test of code of the equation using the value here **/
       })()
       ```
   
 * – and in the second equation the “property_b”:
 *     ```
       (function(){
       var value = db[fieldname1]['property_b'];
   
       /** the test of code of the equation using the value here **/
       })()
       ```
   
 * Note: The fields names and values are hypothetical only to explain the process.
 * Best regards.
 *  Thread Starter [alphi](https://wordpress.org/support/users/alphi/)
 * (@alphi)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-values-per-dropdown-selection/#post-8806162)
 * Brilliant – Thanks! You understood my question perfectly!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multiple values per Dropdown selection’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [alphi](https://wordpress.org/support/users/alphi/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-values-per-dropdown-selection/#post-8806162)
 * Status: resolved