Do a Calculation with an IF statement

[ad_1]

Hello @ti999

Thank you very much for using our plugin.

You have multiple alternatives to implement the equation with conditionals.

Using the IF conditional operation in the plugin:

IF(fieldname5 == 'male', fieldname1+fieldname2, fieldname3+fieldname4)

Using if conditional statement. Javascript is a case-sensitive programming language. Please, do not confuse the IF conditional operation in the plugin with the if conditional statement of Javascript:

(function(){
if(fieldname5 == 'male') return fieldname1+fieldname2, else return fieldname3+fieldname4;
})()

Using the Javascript ternary operator:

(fieldname5 == 'male') ? fieldname1+fieldname2 : fieldname3+fieldname4

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer