• Resolved supersvetodiod

    (@supersvetodiod)


    (function(){
    var result = ”;
    if( AND(fieldname2, fieldname40) ){
    result = fieldname2/fieldname40;

    } else if( AND(fieldname2, fieldname3) ) {
        result =fieldname2/fieldname3;
    }

    else if( AND(fieldname40, fieldname3) ) {
    result =fieldname40*fieldname3;
    }

    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @supersvetodiod

    I’m sorry, but I don’t understand your description. Who are “example1”, “example2”, and “example3” for you?

    Best regards.

    Thread Starter supersvetodiod

    (@supersvetodiod)

    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

    Plugin Author codepeople

    (@codepeople)

    Hello @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

    Best regards.

    Thread Starter supersvetodiod

    (@supersvetodiod)

    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‘);

    } 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‘);
    }

    return result;

    })()

    Plugin Author codepeople

    (@codepeople)

    Hello @supersvetodiod

    You can enter a span tag in the field’s label:

    <span class="text-here"></span>

    And then, as part of the equation, you can include the pieces of code:

    jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' V');
    jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' Ohms');

    and

    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.