Support » Plugin: Calculated Fields Form » If function from excel to CFF

• Resolved asidance

(@asidance)

I just made this formula, but doesn’t work, could someone please identify the mistake im making? Thank you to anyone with future responses.

(function(){
IF(fieldname12=”Semi-Gloss Paper”,0.32,
IF(fieldname12=”Matte Paper”,0.38,
IF(fieldname12=”White BOPP”,0.6,
IF(fieldname12=”Clear BOPP”,0.57,
IF(fieldname12=”Top Coated Direct Thermal Paper”,0.45,
IF(fieldname12=”Thermal Transfer Paper”,0.35))))))
})();

http://wordpress.org/plugins/calculated-fields-form/

Viewing 4 replies - 1 through 4 (of 4 total)
• Plugin Author codepeople

(@codepeople)

Hi,

I recommend you to read any tutorial of javascript. The complex equations in the Calculated Field are made using javascript, so it is recommended some basic knowledge of javasctipt to create complex equations.

For example in the equation posted, I can’t understand what you pretend calculate.

asidance

(@asidance)

let me explain the formula a bit more.

I want the outcome of a dropdown option to change a field’s value.

so if they choose semi-gloss paper the field would be 0.32

I’m not too great with javascript, if you could get me started on how i would do this, I would Greatly Appreciate it.

Plugin Author codepeople

(@codepeople)

The equation should be like follow:

(function(){
if(fieldname12==”Semi-Gloss Paper”) return 0.32;
if(fieldname12==”Matte Paper”) return 0.38;
if(fieldname12==”White BOPP”) return 0.6;
if(fieldname12==”Clear BOPP”) return 0.57;
if(fieldname12==”Top Coated Direct Thermal Paper”) return 0.45;
if(fieldname12==”Thermal Transfer Paper”) return 0.35;
})();

asidance

(@asidance)

THANK YOU VERY MUCH.
Just recently started doing codecademy on javascript.

Also… where do these functions go? and how do i utilize them in a form?

Viewing 4 replies - 1 through 4 (of 4 total)
• The topic ‘If function from excel to CFF’ is closed to new replies.