• Resolved supersvetodiod

    (@supersvetodiod)


    Looked at all the topics, but could not find a solution. I’m asking for help. There is a list of three drop-down boxes. Depending on the choice, we enter the data. I need to get certain data in the calculations. For example: if I select “Amperage”, then the result data should count –

    (function(){
    if(!AND(fieldname2, fieldname40)) return “;

    var result = fieldname2/fieldname40;
    if(fieldname3>fieldname2) return ‘Oops!!! Reduce LED forward’; if I select

    another variable, then I need

    (function(){
    if(!AND(fieldname2, fieldname3)) return “;

    var result =fieldname2/fieldname3;

    if(fieldname3>fieldname2) return ‘Oops!!! Reduce LED forward’;

    and so on.

    For the third variable, there will be a third formula.

    How can this be put together so that, depending on the selection in the drop-down list, calculations are performed only in one window.

    In this case, each calculation should be accompanied by the following inscriptions: the first formula is “Current strength”, the second formula is “Voltage”

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

    (@codepeople)

    Hello @supersvetodiod

    I’m sorry, but I don’t understand your question because I don’t know who the fieldname2, fieldname3, and fieldname40 fields are in your code.

    But in this case, I recommend to check the variables in positive:

    (function(){
        var result = '';
        if( AND(fieldname2, fieldname40) ){
            result = fieldname2/fieldname40;
            
        } else if( AND(fieldname2, fieldname3) ) {
            result =fieldname2/fieldname3;
        }
        if(fieldname3>fieldname2) return 'Oops!!! Reduce LED forward';
        return result;
    })()

    Best regards.

    Thread Starter supersvetodiod

    (@supersvetodiod)

    Yes. it work

    (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

    Plugin Author codepeople

    (@codepeople)

    Hello @supersvetodiod

    I’m sorry, but I don’t understand your question. You are talking about each formula or highlighting specific names, but you have only one formula that checks the different cases and evaluates a mathematical operation or another based on conditional statements.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The drop-down list’ is closed to new replies.