Hello @wp-opti,
The validation rules are checked when the form is submitted, and not when the equiations are evaluated. So, if you want to evaluate the equation:
CEIL(fieldname2*fieldname3/100)
only if fieldname2 is less than or equal to 110 and fieldname3 is less than or equal to 300, the equation should be edited as follows:
IF(AND(fieldname2<=110, fieldname3<=300),CEIL(fieldname2*fieldname3/100), '')
and that’s all.
Best regards.
Thread Starter
Alwin
(@wp-opti)
That worked great; thank you!
I have one more form with the same issue. I can not simply copy-paste your code in that form because the code of the calculated field is already edited like this:
(function(){
var value = fieldname2*fieldname6/100;
if(5 < value) return CEIL(value);
else return CEIL(value,0.5);
})()
So how can I change this code to do the same trick as with the previous issue?
Thank you!
Regards,
Alwin
Hello @wp-opti,
In this case you simply should use the conditional statement “if” of javascript, instead the “IF” operation in the plugin. For example,
(function(){
if(AND(fieldname2<=110, fieldname6<=300))
{
var value = fieldname2*fieldname6/100;
if(5 < value) return CEIL(value);
else return CEIL(value,0.5);
}
return '';
})()
Of course in this case, instead to the values 110 and 300 you should use the values corresponding to this form.
Best regards.
Thread Starter
Alwin
(@wp-opti)
And that worked again!
I hope my rather complex forms (for me) are ready now!
Thank you very much for all your great support so far! I will sure write a great review!!
Regards,
Alwin