Hi!
I have a function in my footer, which looks like that:
<script>
function rolls() {
var totalrolls = Math.ceil(((document.input.input2.value -0) + 53) * (document.input.input1.value -0) / 50000) ;
document.getElementById('txtrolls').innerText=totalrolls;
}
</script>
Then I want to set up a form using Squarespace form block (in lightbox mode) to collect "input1" and "input2" as input fields, and upon submission of the form, call the function "rolls()" and show the value "totalrolls" in the post submit message.
I name the Form Fields "input 1" and "input 2", but how to call "rolls()" upon submission? Or should I call the function in the Post-Submit HTML and show the value there as well?
I don't have it on my website yet (so no link to show) as I am not sure if this is feasible and how..
Thanks for your help!