• Resolved Alwin

    (@wp-opti)


    Please take a look at https://loeka.optiion.nl/canvas/

    When you first select “Canvas” you see 2 number fields both with a max setting (one max 110 and the other max 300).

    Now when you enter a values in these fields that are above the max, a warning text is displayed which is fine!

    But in the calculed field below called “Prijs Canvas” there is still the total price displayed. I would like to display nothing in this field when the values in the number fields are above the max. (Or display a warning text)

    How can I do that?

    Thank you very much.

    Regards,
    Alwin

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

    (@codepeople)

    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

    Plugin Author codepeople

    (@codepeople)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hide calculation’ is closed to new replies.