La fonction de suggestion automatique permet d'affiner rapidement votre recherche en suggérant des correspondances possibles au fur et à mesure de la frappe.
we use a custom code on the base of Hubspot Formular. It uses standard function from Forms API "onFormSubmit" - calculates form fields and displays the result as the form is being sent:
onFormSubmit: function($form){
calculateResult();
ga('send', 'event', 'Landing Pages', 'Form Submit', 'KIWI Rechner');
}
function calculateResult(){
// get the form data
var feld1 = $('input[name="rechner_smart_entry"]').val();
var feld2 = $('input[name="rechner_smart_lock"]').val();
var feld3 = $('input[name="rechner_andere_tueren"]').val();
// calculate the result
result = (feld1 * 634.683 + feld2 * 47.33 + feld3 * 164.83) * 10;
result = result.toLocaleString( navigator.language ,{maximumFractionDigits:0});
// write the result into the hidden result field in the form ...
$('input[name="rechner_ergebnis"]').val(result);
// ... and also display it on the page
document.getElementById("resultContainer").innerHTML = result + ' €';
setTimeout(function(){
document.getElementById("rechner-ergebnis").style.display = "block";
}, 2000);
}
The problem is that it works perfect on desktop, but wrong at the mobile >> the result is being shown after user pushes the submit button but form is not sent and we lose a lead.