We have created the “ROI Calculator” Form
We have used the below code to display the form on the front end.
Page Link: https://bluewave.tekark.com/resources/savings-calculator/
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
region: "na1",
portalId: "20900109",
formId: "451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21"
inlineMessage: "Thank you for trying out the Bluewave Savings Calculator.",
onFormSubmit: function($form, ctx) {
showCalcSavings($form);
}
});
</script>
We have also done some custom code for results calculations as below.
function showCalcSavings($form) {
var mSavings;
var ySavings;
var vVoice = Number($form.find("#voice-451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21").val());
var vInternet = Number($form.find("#internet-451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21").val());
var vDataNetworks = Number($form.find("#data_networks-451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21").val());
var vMobility = Number($form.find("#mobility-451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21").val());
var vWebCon = Number($form.find("#web_conferencing___collaboration-451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21").val());
var vAudioCon = Number($form.find("#audio_conferencing-451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21").val());
var oValidateCharges = $form.find("#do_you_validate_charges_on_a_monthly_basis_-451ff6ec-d3e8-4c14-bce9-7e7ec0b42f21").val();
var vValidateCharges = 0;
if (oValidateCharges === "Yes - every charge") {
vValidateCharges = 0.08;
} else if (oValidateCharges === "Just exceptions above a threshold") {
vValidateCharges = 0.15;
} else if (oValidateCharges === "Not at all") {
vValidateCharges = 0.28;
}
mSavings = Math.round((vVoice + vInternet + vDataNetworks + vMobility + vWebCon + vAudioCon) * vValidateCharges);
ySavings = Math.round(mSavings * 12);
// Update input fields value
$form.find('input[name=annually]').val((ySavings));
$form.find('input[name=monthly]').val((mSavings));
setTimeout(function() {
window.location.href = "https://get-it-right.bluewave.net/technology-assessment-thank-you";
}, 5000);
}
We have received proper data in the mail: Screenshot by Lightshot
After submission on form page is redirected to this page: https://get-it-right.bluewave.net/technology-assessment-thank-you?__hstc=97806976.121bf9be120f42f707ae6f0819f54842.1704876081783.1704876081783.1704876081783.1&__hssc=97806976.3.1704876081784&__hsfp=1749141717&submissionGuid=6869e6b2-a8f5-439f-a958-2b9ce0c6dd21
The main concern is we have not received the below data value on the thank you page. Please see this screenshot: Screenshot by Lightshot
$form.find('input[name=annually]').val((ySavings));
$form.find('input[name=monthly]').val((mSavings));
Please help me to solve this issue.