Auto calculation base slider | WordPress.org

[ad_1]

Hello @ajaysingh121

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

Assuming the slider field is the fieldname1 with min value 0 and max value 100, the equation in the calculate field is fieldname2+fieldname3, and you want to assign the equation’s result to the slider field.

In this hypothetical use case the equation can be implemented as follows:

(function(){
var result = fieldname2+fieldname3,
slider_value = MAX(0, MIN(result, 100));

getField(fieldname1|n).setVal(slider_value);

return result;
})()

Note the use of the |n modifier in the equation. The plugin replaces the fields’ names in the equations with their corresponding values to use in the mathematical operations. The |n modifier tells the plugin you are referring to the fields’ names instead of their values.

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