Gatsby Form not working: form lives on a portal

Hi, I am having issues getting this gatsby form to work.

The Form lives on a gatsby portal (another div) and it seems that netlify can not find it? the form doesnt not work at all. The worst part is that i am not getting any issues telling me the issues.

this is the website: https://eloquent-elion-ad9315.netlify.com/

my form code is this:

import React from "react"
import { SubmitButtom } from "../Button"
import { Form } from "./Form.styled"

const ContactForm = () => {
  return (
    <Form name="contact" method="post" data-netlify-honeypot="bot-field" data-netlify="true" >
        <input type="hidden" name="bot-field" />
        <input type="hidden" name="form-name" value="contact" />
        <label>
            <p>Name</p>
            <input type="text" name="name" placeholder='First and Last name' required/>
        </label>
        <label>
            <p>Business Name</p>
            <input type="text" placeholder='Business name or website link' required/>
        </label>
        <label>
            <p>Phone Number</p>
            <input type="text" name="number" placeholder='(305)-000-0000' />
        </label>
        <label>
            <p>Email</p>
            <input type="email" name="email" placeholder='Email address' required/>
        </label>
        <label>
            <p>Message</p>
            <textarea rows="4" cols="50" name="message" placeholder="In a few words tell me what you are looking for..." required/>
        </label>
        <SubmitButtom type="submit" >Submit</SubmitButtom>
    </Form>
  )
}

export default ContactForm

as you see nothing special… I believe its because the form is being called on click from a portal. any idea how to get netlify bot to read it?

hi there, did you review this post already?

Hi @perry, I have not. Its the first time seeing that topic.
I will get back you if I do not find a solution.

Thank you!

1 Like

of course. if you search for “common issue forms” you will see a few other guides we have written.

If nothing helps, let us know and we’ll take another look.

Hey @perry,

I have tried almost everything I event notice some issues with my form like a

tag shouldnt be in there instead i added a span, I also included htmlFor on label since i am using react.

but nothing.
here is the netlify link to the website: https://eloquent-elion-ad9315.netlify.com/ incase you might want to take a look at the html.

@Madgeniusblink, I think found the root cause. There is no HTML version of the form in the deployed files.

It appears the HTML form is created at browse time by the site javascript. However, for Netlify to create the backend to accept form submissions a pure HTML version of the form must exist in the deployed HTML files. There is more information about this in our documentation here, quoted below:

Work with JavaScript-rendered forms

Our bots find your forms by parsing the HTML of your site when the build completes. This means that if you’re using JavaScript to render a form client-side, our bots won’t find it in the pre-built files. You can work around this by creating a hidden HTML form with the data-netlify="true" attribute and input fields with name attributes to match the inputs of your JavaScript-rendered form. You need to apply the same work around if you want to use our reCAPTCHA 2 integration, and create a div element in the hidden HTML with the data-netlify-recaptcha="true" attribute.

You can also find related tutorials on our blog:

While the two articles are fairly framework-specific, the code demonstrates how to prerender forms when working with them in a web application.

To summarize, please make certain that an HTML version of the form is present in the deployed files as this is required for the post processing at Netlify to create the endpoint for accepting the form submissions.

If there are other questions about this, please let us know.

Wow @luke,

Thank you! i will take a look at tutorials and give them a try and get back to you!

Thank you in advance!