Gatsby: Submit Form Redirect

Created on 2 Aug 2019  路  2Comments  路  Source: gatsbyjs/gatsby

So I've been looking around for HTML forms for static sites and some that I've found like https://jumprock.co/ uses <input type="hidden" name="after" value="http://google.com"> for redirection, however this will trigger a full page reload.

So what I'm asking is:

  1. Is there any other way to have the value to perhaps change a portion of my page to show a success return message
  2. Or, perhaps a timed based reload? So it'll show a success page and then after 5 seconds load back an empty contact page?

I'm new to Gatsby and React, so more descriptive would be appreciated. Thanks!

All 2 comments

See the docs for adding forms.

Hi @wheelbot,

As @elken suggested we have documentation on how to add a form to gatsby. We also have a more advanced page called how to build a contact form.

Netlify has a blog post how you can do it in react which should also work for gatsby. https://www.netlify.com/blog/2017/07/20/how-to-integrate-netlifys-form-handling-in-a-react-app/

I'm marking this issue as answered and closing it for now but please feel free to re-open this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby! 馃挏

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

signalwerk picture signalwerk  路  3Comments

KyleAMathews picture KyleAMathews  路  3Comments

ghost picture ghost  路  3Comments