Title: dropdown
Last modified: January 19, 2024

---

# dropdown

 *  Resolved [supersvetodiod](https://wordpress.org/support/users/supersvetodiod/)
 * (@supersvetodiod)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dropdown-31/)
 * (function(){
   var result = ”;if( AND(fieldname2, fieldname40) ){result = fieldname2/
   fieldname40;
 *     ```wp-block-code
       } else if( AND(fieldname2, fieldname3) ) {
           result =fieldname2/fieldname3;
       }
       ```
   
 * else if( AND(fieldname40, fieldname3) ) {
   result =fieldname40*fieldname3;}
 *     ```wp-block-code
       return result;
       ```
   
 * })()
 * These formulas calculate data in a specific field. But how do I make sure that
   each formula highlights only its specific name when calculating. For example,
   if the previous formula is calculating, then it is necessary to issue “example
   1”, if the second formula, then “Example 2”, if the third, then “Example 3”.
 * [https://disk.yandex.com/i/whNMk1x_ZSaFgw](https://disk.yandex.com/i/whNMk1x_ZSaFgw)

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dropdown-31/#post-17357238)
 * Hello [@supersvetodiod](https://wordpress.org/support/users/supersvetodiod/)
 * I’m sorry, but I don’t understand your description. Who are “example1”, “example2”,
   and “example3” for you?
 * Best regards.
 *  Thread Starter [supersvetodiod](https://wordpress.org/support/users/supersvetodiod/)
 * (@supersvetodiod)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dropdown-31/#post-17358243)
 * I need to calculate three values.
 * Depending on what we select in the drop-down list. So there is a choice in the
   drop-down list: “Amperage”, “Voltage” and “Resistance”.
 * In order to calculate “Amperage” I have to enter data in fields 2 and 3.
 * In order to calculate “Voltage” I have to enter data in fields 2 and 40.
 *  In order to calculate the “Resistance” I have to enter the data in fields 2 
   and 3.
 * The functions solve these problems.
 *  But in the “Results” field, you can somehow implement it so that, depending 
   on what value I calculate, information appears in the field header that I have
   now calculated “Current strength” or “Voltage” or “Resistance”.
 * [https://disk.yandex.com/i/whNMk1x_ZSaFgw](https://disk.yandex.com/i/whNMk1x_ZSaFgw)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dropdown-31/#post-17358286)
 * Hello [@supersvetodiod](https://wordpress.org/support/users/supersvetodiod/)
 * In this case, you should insert three separate calculated fields for Amperage,
   Voltage, and Resistance with their corresponding equations and configure them
   as dependent on the DropDown field. Only the fields associated with the selected
   choice would be visible.
 * Learn more about dependencies by reading the following blog post:
 * [https://cff.dwbooster.com/blog/2020/03/01/dependencies](https://cff.dwbooster.com/blog/2020/03/01/dependencies)
 * Best regards.
 *  Thread Starter [supersvetodiod](https://wordpress.org/support/users/supersvetodiod/)
 * (@supersvetodiod)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dropdown-31/#post-17358319)
 * I have set this up, but it is when the calculation takes place, in the calculation
   header itself, that I need a caption to be displayed, depending on the calculation,
   that we calculated “Current strength, or “Resistance”. So far, I have only achieved
   the ability to display this in text mode. But it is precisely above the “results”
   field that there is a heading. It is static.
 * (function(){
   var result = ”;if( AND(fieldname2, fieldname40) ){result = fieldname2/
   fieldname40;jQuery(‘.text-here1’).html(‘Voltage drop on all LEDs – **‘+result
   +’ V**‘);
 *     ```wp-block-code
       } else if( AND(fieldname2, fieldname3) ) {
           result =fieldname2/fieldname3;
       ```
   
 * jQuery(‘.text-here2’).html(‘Voltage drop on all LEDs – **‘+result+’ Ohms**‘);
   }
   else if( AND(fieldname40, fieldname3) ) {result =fieldname40*fieldname3;
 * jQuery(‘.text-here3’).html(‘Voltage drop on all LEDs – **‘+result+’ A**‘);
   }
 *     ```wp-block-code
       return result;
       ```
   
 * })()
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dropdown-31/#post-17358372)
 * Hello [@supersvetodiod](https://wordpress.org/support/users/supersvetodiod/)
 * You can enter a span tag in the field’s label:
 *     ```wp-block-code
       <span class="text-here"></span>
       ```
   
 * And then, as part of the equation, you can include the pieces of code:
 *     ```wp-block-code
       jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' V');
       ```
   
 *     ```wp-block-code
       jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' Ohms');
       ```
   
 * and
 *     ```wp-block-code
       jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' A');
       ```
   
 * In the corresponding blocks.
 * Best regards.

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

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

 * 5 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/dropdown-31/#post-17358372)
 * Status: resolved