Static Website: Prevent Submission Page?

Hi There,

I am trying to build a price calculator for my website using forms and basic JS with static HTML.

The calculator works perfectly but I want to be able to see the information that my potential clients have been putting into the calc so that whenever they contact me for a quote I can pull up their information and assist them better.

Everything works perfect apart from whenever the potential client clicks “Calculate” it will redirect them to the submission successful page and when they go back, the calculated quote is gone. I still receive the form details, but the client doesn’t get to see the quote because of the submission redirect.

Is there anyway to switch off the submission redirect on Netlify forms and still be able to receive the information the potential client has put into the form whenever they click the “calculate” button?

My deployed website is:

If you go to “Pricing” you will see what I mean


Hi @mont266,

You can submit forms using AJAX. An example is given in the Netilfy Docs Forms setup | Netlify Docs

1 Like

I’ve set up AJAX with my form and called it using onSubmit.

I’m still getting the same result where the page either refreshes or it goes to the message success screen. Is there anyway in the AJAX code I can literally make the form do nothing onSubmit apart from send the information in the forms to my netlify dashboard?

You need to prevent the default behavior of the form when using Ajax, for instance event.preventDefault(), based on your code, it seems like you already figured this out :slight_smile: