Hello all,
So I have a client side google form as a contact form and currently after submission it redirects to google’s thank you page. I would like it to go to a custom thank you page after submission. The problem is all the solutions I’ve seem to find require inline javascript. So far that I know of, I can’t use script tags or import javascript files into my react components, I can only write JSX. Here is what my code looks like. Any solution that would work with my reactjs situation? Thanks a bunch!
<form action="https://docs.google.com/forms/d/e/1FAIpQLSez3SXaKvZ8EgjbKmrKKzJSvFj4mkxTDgj8-sL7Ogau309UkA/formResponse" target="_self" id="bootstrapForm" method="POST"> `
** various inputs and a submit button
</form>
This is just vanilla HTML, nothing about it says JSX. It’s just a standard HTML submit. If you’re doing a standard HTML submit, there’s not really much you can do.
JSX would usually look something like this
<form onSubmit={handleSubmit}>
{/* various inputs and a submit button */}
</form>
Correct, JSX is different from html, but the fact of the matter is I can’t use script tags in my code. It would be impossible to add your handleSubmit function. Maybe I’m wrong but I can’t find any documentation on any way to add JavaScript to an react component/jsx
JSX is simply the templating language for a React component. You don’t put your JS inside your JSX. Like most other templating languages, JSX specifically inhibits your ability to write much functional code inside of it.