Title: Drop Down Calculation
Last modified: August 31, 2016

---

# Drop Down Calculation

 *  Resolved [Javy26](https://wordpress.org/support/users/javy26/)
 * (@javy26)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/drop-down-calculation-1/)
 * Was wondering if using the drop down in this scenario is possible.
 * Let’s assume the drop down is populated with the values: jewellery, clothing,
   computer part.
 * We have two other fields, the field where the user inputs(let’s call it field
   1) and also where the result is generated(let’s call this field 2).
 * And the drop down we will refer to it as field 3.
 * What I want is something like this:
 * 1. Value for field 1 is entered
    2. Field 2 value is determined for eg. by this
   calculation: if field 3 is jewellery then field 1 is equated to field 1*2.
 * Is this possible?
 * Regards,
 * Jevon
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/drop-down-calculation-1/#post-6941005)
 * Hi,
 * Yes, of course, you can use conditional statements in the equations, there are
   different ways, for example, all the equations below, associated to the calculated
   field you will return the same result:
 * Using the operation “IF”:
 * `IF( fieldname3 == 'jewellery', fieldname1*2, fieldname1)`
 * Note: javascript is a programming language case sensitive, do not confuse the
   operation “IF” implemented by the plugin, with the conditional statement “if”
   in javascript.
 * Using the ternary operator in javascript:
 * `( fieldname3 == 'jewellery' ) ? fieldname1*2 : fieldname1`
 * Using the conditional statement in javascript:
 *     ```
       (function(){
       if(fieldname3 == 'jewellery') return fieldname1*2;
       else return fieldname1;
       })()
       ```
   
 * Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Drop Down Calculation’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/drop-down-calculation-1/#post-6941005)
 * Status: resolved