• Resolved Zabec

    (@evdapparel)


    Hello,

    Currently I have an IF statement like this…

    (function(){

    if(fieldname3 == ‘Postpaid Activation (Lines 1-2)’) return fieldname12*4.5;

    })();

    The thing is…I have a fieldname13 with a selection as well. So, basically I’m trying to nest the IF with AND…For example I’m trying to have it break down like this…

    If a user selects Fieldname3 ==’Selection’ and then selects Fieldname13 == ‘Selection’
    return Fieldname12*4.5

    Would something like this be possible with if(and(?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Zabec

    (@evdapparel)

    Resolved…seemed all that I needed to do is put the symbol &. Then continue with the other option.

    (function(){

    if(fieldname3 == ‘Selection’ & fieldname13 == ‘Selection’) return fieldname12*4.5;

    })();

    ^ In case anyone was needing the same thing.

    Plugin Author codepeople

    (@codepeople)

    Hello @evdapparel

    Not exactly. In javascript, the “AND” operator is the double ampersand symbols (&&) a single ampersand has a different use. So, the equation would be:

    
    (function(){
    
    if(fieldname3 == 'Selection' && fieldname13 == 'Selection') return fieldname12*4.5;
    
    })();
    

    Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using IF with AND together’ is closed to new replies.