Calculator is not loading

The preloader icon is spinning and the calculator is not loading on the page.

Are you experiencing users being unable to see the calculator on the page?

This is a very common issue that is most likely related to the following reasons:

  • Formula field contains non-existing element.

  • Formula field contains not logical calculations.

  • Incorrect usage of the if/else statements in Formula field.

Formula field contains non-existing element.

the Formula field which is used on your calculator. The fastest way to rule this issue out is to check the console using Browser developer tools.

In our example calculator is searching for quantity_field_id_10, but it does not exist. To make sure let's check your Formula field and used elements:

While checking the formula field you can see there is an incorrect element used. After removing or adding new elements into pre-built calculators, use correct calculations in the Formula field.

Incorrect usage of the if/else statements in Formula field

While adding a conditional statement in the format of JavaScript code make sure that you followed JavaScript Standard and validated before directly pasting it to the Formula filed. When if/else statements are not finished the Calculator may stop loading on the Page. Here is an example:

if (radio_field_id_2 == 30) {
    if (dropDown_field_id_1 == 1) {
        50 + radio_field_id_2 +  toggle_field_id_8 
    } else if (dropDown_field_id_1 == 2) {
        100 + radio_field_id_2 +  toggle_field_id_8 
    } else if (dropDown_field_id_1 == 3) {
        150 + radio_field_id_2 +  toggle_field_id_8 
    } else {
        180 + radio_field_id_2 +  toggle_field_id_8 
} else {
    if (dropDown_field_id_1 == 1) {
        10 +  toggle_field_id_8 
    } else if (dropDown_field_id_1 == 2) {
        20 +  toggle_field_id_8 
    } else if (dropDown_field_id_1 == 3) {
        30 +  toggle_field_id_8 
    } else if (dropDown_field_id_1 >= 3){
        40 +  toggle_field_id_8 

The if/else statement is wrong in this example because it is ending with "else if" in the else part of the snippet.

Last updated