Title: Submit button for email
Last modified: June 11, 2020

---

# Submit button for email

 *  Resolved [piotr1985](https://wordpress.org/support/users/piotr1985/)
 * (@piotr1985)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/submit-button-for-email/)
 * Is there a way to have the Submit button appear on the second page of this form–
   where the users enter their contact information?
    That way the email is sent 
   before they see the results of the calculation.
 * Would this be done by inserting a button with a special script that submits the
   form and then goes to the final page with the calculation results?
 * We don’t want the user to have to Submit and then click next, otherwise they 
   may skip the required lead gen form.
 * Thank you!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsubmit-button-for-email%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/submit-button-for-email/#post-12972279)
 * Hello [@piotr1985](https://wordpress.org/support/users/piotr1985/)
 * There are different alternatives.
 * The easier solution:
 * * Tick the checkbox: “Hide Field From Public Page” in the settings of the calculated
   fields.
 * * Insert the shortcode for results in the thank you page associated to the form:`[
   CP_CALCULATED_FIELDS_RESULT]` ([https://cff.dwbooster.com/documentation#thanks-page](https://cff.dwbooster.com/documentation#thanks-page))
 * * Finally, insert the URL to this page into the “Thank you page” attribute of
   form’s settings.
 * Now, you can configure the other fields in the form as required. So, the user
   needs to submit the form to see the results in the thank you page, and for submitting
   the form, it is necessary to populate the required fields.
 * The second alternative would be collect the fields values in background using
   a server side equation. Please, read the following post in the plugin’s blog:
 * [https://cff.dwbooster.com/blog/2019/08/04/partial](https://cff.dwbooster.com/blog/2019/08/04/partial)
 * Best regards.
 *  Thread Starter [piotr1985](https://wordpress.org/support/users/piotr1985/)
 * (@piotr1985)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/submit-button-for-email/#post-12973150)
 * 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!
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/submit-button-for-email/#post-12973571)
 * Hello [@piotr1985](https://wordpress.org/support/users/piotr1985/)
 * The issue is simple, your calculated field has no value, because you are using
   it as auxiliary to display the results in a HTML Content field, and the HTML 
   Content fields are not submitted.
 * Please, edit your equation as follows:
 *     ```
       (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);
   
       return jQuery('[id*="fieldname'+'77_"]').html();
       })()
       ```
   
 * and then, submit the form again with the shortcode for results in the thank you
   page.
 * Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

 The topic ‘Submit button for email’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form - AI Form Builder for WordPress - Contact, Payment, Quote, Quiz & More](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/submit-button-for-email/#post-12973571)
 * Status: resolved