• Caldera Forms is a great plug-in, thank you for all of the work it must have taken so far. My problem: I have a calculation field that is using a Math.min() function to cap a discount at 33%. The field calculates correctly in the form, but the field is 0 or empty when it is saved in the entries, and on the email being sent out. My formula is: %annual_total_pre_discount% * ((Math.min(%forms_to_file% * %volume_discount_per_100%, 33)) / 100)

    It seems like all of the calculation fields are being run again on submit, and that function isn’t working. Is there anything I should be doing to this formula to get it to work in all places?

    https://wordpress.org/plugins/caldera-forms/

Viewing 1 replies (of 1 total)
  • Thread Starter corum999

    (@corum999)

    Some additional details that I have found: Using the php min() function works for the data entry and email. using the javascript Math.min() function works on the screen in the form. I was stumped as to why the pow() function used in the Loan Calc demo was working until I found a fix made in field.php specifically to str_replace ‘pow(‘ with ‘Math.pow(‘.
    Can this fix be updated to address additional javascript math functions so we can use more than POW()?

Viewing 1 replies (of 1 total)
  • The topic ‘Calculation field, javascript Math.min() not saving as entry or on email’ is closed to new replies.