• Resolved victoriei101

    (@victoriei101)


    Hello, can you please help me with this? I’ve added a radio button field (fieldname33) with 2 fields 1 and 2, and I want to calculate 3% if field 1 is selected, and 1% if field 2 is selected.

    This 1st part is good, (worked for previous calculation)

    (function(){
    var v = fieldname2*((fieldname16 == 'Euro') ? curs : 1);

    but I don’t know how to write this 2nd part

    if(fieldname33 == '1')*.03, 0);
    if(fieldname33 == '2')*.01, 0);

    and put both parts together. Thank you

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

    (@codepeople)

    Hello @victoriei101

    Thank you very much for using our plugin. You can implement the equation as follows:

    (function(){
    var v = fieldname2*((fieldname16 == 'Euro') ? curs : 1);
    
    if(fieldname33 == 1) v = v*0.03;
    if(fieldname33 == 2) v = v*0.01;
    
    return v;
    })()

    Best regards.

    Thread Starter victoriei101

    (@victoriei101)

    Perfect, thank you.

    • This reply was modified 1 year, 11 months ago by victoriei101.
    Plugin Author codepeople

    (@codepeople)

    Hello @victoriei101

    If you want to round the result, you can edit the equation as follows:

    (function(){
    var v = fieldname2*((fieldname16 == 'Euro') ? curs : 1);
    
    if(fieldname33 == 1) v = v*0.03;
    if(fieldname33 == 2) v = v*0.01;
    
    return ROUND(v);
    })()

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional radio button’ is closed to new replies.