Forum Replies Created

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

    (@piotr1985)

    Those were really helpful but I’ve run into an issue with each solution.

    I followed the directions for the server side equation but it doesn’t seem to work.
    I did reset the 3 fieldnames to be fieldname14, fieldname55, fieldname48 based on the fields for name, company and email in the form. It doesn’t seem to run however because no email comes in and there is no delay in loading the last page of the form. When submitting before going to a thankyou page, there’s a delays which the server checks and sends the email.

    The Thank you page (which we do get an email from) doesn’t show the calculation.

    The shortcode [CP_CALCULATED_FIELDS_RESULT] shows the data that was input into the fields, but not the calculated amounts. I tried adding the html from page 3 of the calculator, but the fields remain empty. I assume because those jQuery scripts are not running on this page.

    This is the code used to display the calculations with jQuery for the Span tags. It displays beautifully in the plugin but does not work on a thank you page.

    (function(){
    var annual = (fieldname19*(fieldname13/100)),
    revlostweek = (annual/52),
    revlostweek1 = (PREC(revlostweek,2)),
    revlostday = (PREC(annual/365,2)),
    revlosthour = (PREC(annual/8760,2)),
    revlostmin = (PREC(annual/525600,2)),
    productivity = (fieldname20/100),
    prodlosthour1 = ((fieldname3*fieldname72)*productivity),
    prodlosthour2 = (PREC(prodlosthour1*1,2)),
    prodlostmin = (PREC(prodlosthour2/60,2)),
    prodlostday = (PREC(prodlosthour2*24,2)),
    prodlostweek = (PREC(prodlosthour2*168,2)),
    totalmins = PREC(SUM(revlostmin, prodlostmin),2),
    totalhrs1 = PREC(SUM(revlosthour,prodlosthour2),2),
    totalday1 = PREC(SUM(revlostday, prodlostday),2),
    totalweek1 = PREC(SUM(revlostweek, prodlostweek),2),
    annualtotal = (fieldname19),
    annualpercent= (fieldname13),
    employeenum = (fieldname3),
    employeecost = (fieldname72),
    employeepercent = (fieldname20);
    
    jQuery('.revlost_week').html(revlostweek1);
    jQuery('.revlost_day').html(revlostday);
    jQuery('.revlost_hour').html(revlosthour);
    jQuery('.revlost_min').html(revlostmin);
    jQuery('.prodlost_hour').html(prodlosthour2);
    jQuery('.prodlost_min').html(prodlostmin);
    jQuery('.prodlost_day').html(prodlostday);
    jQuery('.prodlost_week').html(prodlostweek);
    jQuery('.total_mins').html(totalmins);
    jQuery('.total_hours').html(totalhrs1);
    jQuery('.total_days').html(totalday1);
    jQuery('.total_week').html(totalweek1);
    jQuery('.annutotal').html(annualtotal);
    jQuery('.annupercent').html(annualpercent);
    jQuery('.empnum').html(employeenum);
    jQuery('.emppercent').html(employeepercent);
    jQuery('.empcost').html(employeecost);
    })()

    Thanks so much for the support!

Viewing 1 replies (of 1 total)