Just to summarize eventually I would like
If metric selected calculate (Lxwxh)/1000 to get volume in liters
If I imperial do (((l*w*h)*2.54)/1000)
Hello @matt130190
You are confusing the operation “IF” distributed with the plugin, and the “if” conditional statement of javascript (remember that javascript is a case sensitive programming language)
For example, assuming you want to return the text False if fieldname12 value is Metric and the text True in other cases.
Using the “IF” operation distributed with the plugin:
IF(fieldname12 == 'Metric', 'False', 'True')
Pay attention, the “IF” operation requires three parameters: condition, operations if the condition is true, and operations if the condition is false.
Now the same equation using the javascript conditional statement “if”. In this case you require to implement the equation with function structure:
(function(){
if(fieldname12 == 'Metric') return 'False';
return 'True';
})()
A third alternative using the ternary javascript operator:
(fieldname12 == 'Metric') ? 'False' : 'True'
Best regards.
Hi
Thank you for your quick reply unfortunately it’s still not working 🙁 I’m not sure if this will work but please see photos below
Photos
It doesn’t seem that radio button is being recognized
Thanks so much in advance
So in theory it should display false unless metric is selected then display true
-
This reply was modified 7 years, 6 months ago by
matt130190.
Hello @matt130190
In the equations you always use the values of the fields and not the texts of the choices. The checkbox: “Value to submit” only affects to the value to submit and not to the equations, so, the equation would be:
(function(){
if(fieldname12 == 'X') return 'False';
return 'True';
})()
Best regards.
Yay is now working, thankyou so much 🙂