Calculate Type of Button Field Isn’t Work Properly

[ad_1]

Hello @serkanyaman

Thank you very much for using our plugin. You can use conditional statements or conditional operations in the equation.

I’ll try to describe the process with a hypothetical example.

Assuming you have three fields, fieldname1, fieldname2, and fieldname3 and you want to calculate the average. The basic equation would be:

AVERAGE(fieldname1, fieldname2, fieldname3)

But if you want to evaluate it only after the user enter the fields’ values, you should edit the equation as follows:

IF(AND(fieldname1, fieldname2, fieldname3), AVERAGE(fieldname1, fieldname2, fieldname3), '')

If you prefer to implement the equation with function structure and the “if” conditional statement instead of the “IF” operation, it would be:


(function(){
if(AND(fieldname1, fieldname2, fieldname3))
return AVERAGE(fieldname1, fieldname2, fieldname3);
})()

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