Number / Predefined Value / It is possible to use another field in the form as p

Hello @mikelalgas

Thank you very much for using our plugin. When the plugin generates the number field the equations associated with the calculated fields have not been evaluated yet. So, the default value of the number field will be zero or empty.

The alternative would be to assign the equation result to the number field from the same equation.

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

Assuming you have the calculated field fieldname1 with the equation fieldname2+fieldname3 and you want to assign the result to the number field fieldname4

Please, edit the equation as follows:

(function(){
var result = fieldname2+fieldname3;
getField(fieldname4|n).setVal(result);
return result;
})()

The plugin replaces the fields’ names in the equations with their corresponding values before evaluating them. The |n modifier tells the plugin you want to use the field’s name instead of its value.

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