I have an extremely simple form. But when I test the form, my name doesn’t show up in the email. It does however show up in the Netlify form dashboard. So I know I built things right, but I assume someone might want to know about this bug.
Hmm, that is quite odd! I can see your definition has no “label” for name in our database - just an "" empty string…but the email field is the same and that comes through. The Message also has no label - but instead of being an empty string, it has a literal “nil” in the database instead of an empty string value.
Could you link me to the html page on your site that has the form so I can poke a bit more? I couldn’t find it by browsing around the page.
I’m having an issue that might be related with this one. I’m posting via fetch on Gatsby. I don’t understand what’s going on there, but it looks like the submissions I’m receiving have all the wrong label.
I wrote also a question here but we can continue on this thread
I’ve tried your way but it doesn’t work as well. To give to you a little bit of contect, I’m using Formik to render my form, so at the moment the only thing not implement is the e.preventDefault() method at the end of the post function. Here’s the form itself:
The point is that, since I’m manually set the values on the post request, why the form gets other values form the form labels? Here are the console.log of the data I’m supposed to send,
with the encode method: form-name=contact-us&name=Ivan&email=ivan.test%40test.com&message=Test%20message
with the createFormDataObj method: form-name=contact-us&name=Ivan&email=ivan%40test.com&message=Test+message+for+you
As you can see in both the cases the labels are set correctly set, but apparently not sent, and in the end is not what I get on the dashboard
To clarify, my ideal “scenario” would be to send the data only via fetch to avoid completely Netlify to check the form labels. I’ve also tried for instance to remove the data-netlify or any reference to the form itself, but of course, it’s not working.
Unfortunately, I need to use Formik here, so I can’t really build a “flat” form to replace it (even if I don’t think it’s about formik, as you can see in the screenshot posted, the HTML result is as expected and the inputs’ name attributes are correctly set).
I’m confused because the only post request is sent by fetch, where I’m basically “hardcoding” the keys. So actually the point is: is the fetch call sending data to the dashboard or it’s just skipped completely?
I think I’ve found a solution. I’ve created a fake form outside the Formik's form element, with all the necessary Netlify attributes (right form name, data-netlify) in order to let Netlify pick the right markup
Awesome, I’m so glad you’re up and running now and really appreciate you sharing your full fix here- someone else was running into trouble with their Formik form the other day, going to point them to your post!