Title: Terms from dropdown menu
Last modified: December 12, 2022

---

# Terms from dropdown menu

 *  Resolved [musali](https://wordpress.org/support/users/musali/)
 * (@musali)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/terms-from-dropdown-menu/)
 * Is it possible to have a term that states that if the user selects a name in 
   a droplist the form should execute term 1 and else execute term 2?
 * For example:
 * fieldname1(Dropdown)
    – New York – Detroit
 * fieldname2(newyork)
    – 10 fieldname3(detroit) – 7
 * if user picks detroit in dropdown menu then go on to calculate fieldname3 else
   fieldname2.
 * In my code i’ve written for the given example IF(fieldname1 = Detroit, fieldname3,
   fieldname2)

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/terms-from-dropdown-menu/#post-16281170)
 * Hello [@musali](https://wordpress.org/support/users/musali/)
 * In javascript, the operator for the equality is the double equal symbol `==` 
   because the `=` symbol is used for assignment. Additionally, the textual values
   in the equations must be enclosed between single or double quotes. So, the correct
   equation would be:
 * `IF(fieldname1 == 'Detroit', fieldname3, fieldname2)`
 * Note you have other alternatives:
 * * You can enter the numbers 10 and 7 as the values of the “New York” and “Detroit”
   choices in the fieldname1, respectively, and the equation would be:
 * `fieldname1`
 * * You can configure the fieldname2 and fieldname3 fields as dependent on the 
   fieldname1 choices ([https://cff.dwbooster.com/blog/2020/03/01/dependencies](https://cff.dwbooster.com/blog/2020/03/01/dependencies)),
   and given that values of dependent fields are zero when they are disabled, the
   sum operation would not be affected by them. So, you could implement the equation
   as follows:
 * `SUM(fieldname2, fieldname3)`
 * Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Terms from dropdown menu’ 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/)

## Tags

 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [if](https://wordpress.org/support/topic-tag/if/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/terms-from-dropdown-menu/#post-16281170)
 * Status: resolved