General rule for the entire form

[ad_1]

I have a form with various dependencies. Is it possible to give an instruction that implements the following:if one value of an equation is 0, then the whole equation is 0.

Example: I calculate fieldname1 (5) + fieldname2 (7) = 12
So far so simple. But if fieldname1 is not 5 but 0, then
7 should be the result. (fieldname1 (0) + fieldname2 (7) = 7).
In this case, however, I want the entire result to be 0.

The point is that users can calculate something in the frontend. One value is determined in the background by calculations and the other value must not be 0. If it is, the entire equation must be 0. (Otherwise a different result is calculated in the background). If one value is 0, everything must be 0.

Can something like this be implemented?

 

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