PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Field type 'Calculation' - TypeError: expr is undefined

  1. We have an Gravity Forms form with two 'Calculation' product fields.

    Veld ID 27 - Product - Calculation
    ( {Je wilt::8} ) / 100 ) * 35

    Veld ID 28 - Product - Calculation
    {payment_amount} - {payment_amount}

    This results however in an blank page, the form is hidden. We see the following error in Firebug:

    TypeError: expr is undefined
    /wp-content/plugins/gravityforms/js/gravityforms.js?ver=1.6.7
    Line 847

    Any idea how we can fix this?

    Posted 12 years ago on Friday September 28, 2012 | Permalink
  2. Your calculation looks to be missing a "(" or you have an extra ")" in it.

    Does the form show and work in the form builder preview window? Do you have a link to the live form?

    Posted 12 years ago on Friday September 28, 2012 | Permalink
  3. We have a link to the live form with the Calculation forms: https://cdaformulieren.nl/cdja/congres/

    Posted 12 years ago on Monday October 1, 2012 | Permalink
  4. Did you check your calculation for the proper syntax? From what you posted here you are missing a parenthesis in the calculation for field 27. Is that a paste error here or is your actual formula incorrect?

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  5. This is not a paste error. It is the code we use in the form.

    Posted 12 years ago on Wednesday October 3, 2012 | Permalink
  6. As Rob explained, you have an error in your formula. You have mismatched parentheses. I think you want to do something like this:

    [php]
    {Je wilt::8} * 0.35

    or

    [php]
    ( {Je wilt::8} / 100 ) * 35

    I'm not certain what your calculation should be, so I am unsure of there the parentheses need to be. One of those two formulas should work for you.

    Posted 12 years ago on Wednesday October 3, 2012 | Permalink