Hello @horizons66
Thank you very much for using our plugin. Please provide the link to the page that contains the form to check your dependencies and the equation’s result.
Best regards.
Hello @codepeople
I haven’t published the page with the form yet. Can I send you the link with a private message to access the reserved area or I’ll make you a video and post it here? Thank you
Hi @codepeople
this is a video captured from the page
https://youtu.be/6l8FGWAeDVM
Thank you!
Hello @horizons66
Your equation does not require using the SUM operation. It can be implemented as fieldname2-fieldname6. I don’t know why you include a minus symbol in front SUM operation. But if you do it because the subtraction returns a negative number and want to make it positive, the correct would be using the ABS operation.
ABS(fieldname2-fieldname6)
Regarding the dependencies conditions issue, in JavaScript, the symbol for decimals is the point, not the comma. You can configure the fields to display commas as decimal separators, but in the code, you must use a valid symbol.
So, the conditions would be:
1.65 <= value
1.55 <= value && value < 1.65
1.40 <= value && value < 1.55
Best regards.
thank you so much @codepeople!
what if I don’t want any image to appear until all the fields involved in the operation are filled in?
Hello @horizons66
In this case, you can check the fields values before evaluating the equation:
IF(AND(fieldname2|r != '', fieldname6|r != ''), ABS(fieldname2-fieldname6), '')
The plugin preprocesses the fields’ values to extract numbers to use in the mathematical operations. The |r modifier tells the plugin you want to access the field’s raw value instead of the preprocessed one.
Best regards.
thanks @codepeople! One last piece of information: what if I didn’t want to display the field with the result of the calculation but only the button with the color? Thank you!
Hello @horizons66
To hide the calculated field, you should only tick the “Hide field from public page” checkbox in its settings.
Best regards.
thanks @codepeople!
but the code you sent me previously (IF(AND(fieldname2|r != ”, fieldname6|r != ”), ABS(fieldname2-fieldname6), ”) doesn’t work. The red button remains (plus value lower closer to 0, because 0 is already displayed by default in the field before entering the data in the calculation field
Hello @horizons66
I’m sorry, but it is hard to help you if I cannot check your dependencies.
If you have a dependency that includes the zero value in the conditions, you must ensure the result is not empty. For example, assuming you want to display an element if the value is less than or equal to 1:
value <= 1
You can edit it as follows
value <= 1 && value|r != ''
Best regards.
Thanks again @codepeople. I will purchase a developer license because I need more features
hello @codepeople, I have to add another operation (+ 10.08) to this equation PREC (((fieldname4)* 1.8254),2,true) but every time I add + 10.08 to this equation, that number is displayed in the calculation field before all fields are filled in. Where am I wrong? Thank you
Hello @horizons66
PREC must be the outermost operation in the equation because it will format the final result. So, the equation would be:
PREC (fieldname4*1.8254+10.08, 2, true)
Best regards.
hello @codepeople, Thanks for the reply! What if the value of fieldname4 is a result of another equation on the same form? Because in the end nothing has changed, in the calculated field of the PREC equation (fieldname4*1.8254+10.08, 2, true) 10.08 is displayed by default, even if the final calculation is correct. It’s just a matter of visualization…..
Hello @horizons66
If you want to add 10.08 only after evaluating fieldname4, you can use conditional operations in the equation:
IF(fieldname4|r != '', PREC (fieldname4*1.8254+10.08, 2, true), '')
Best regards.