It’s within the fetch that I think I am failing. values is correctly received and can be formatted correctly. But other than that I’m not sure where I am going wrong.
Hey there,
A few suggestions: can you take a look at the request in the browser dev tools and see if it’s formatted correctly there, in the POST? If you want to drop a link to your Netlify URL where the form lives, we can give more instruction on how to do that!
The other thing is that you made need to create a FormData object and pass that to the URLSearchParams, as shown in our docs here:
The two main differences are the values and form-name.
The values are received and encoded properly. The exact same as the working form. But when testing submission, only the first form is received, the second form seems to successfully send but doesn’t appear in the dashboard.
Our support team can help troubleshoot the actual form but not your code above. Troubleshooting third-party code like this javascript isn’t covered in the scope of our support. Even for Enterprise customers (unless they have a custom support contract), we don’t troubleshoot third-party code. My point being, we are not refusing to help because this is on the community site. We almost never troubleshoot third-party code.
Questions about custom code are welcome here on this forum but you will be relying on other community members for that troubleshooting. Someone else here may be willing to troubleshoot but our support team general speaking simply doesn’t have the bandwidth available to look at custom code.
Note, if you send us a link to the live form as Jen mentioned, our support team would be happy to take a look at what is being sent to our form handler. We cannot troubleshoot the javascript but we can confirm if the form submission to our form handler is being sent correctly or not. (In other words, we can troubleshoot the POST itself but not the code that generates it.) If that would be helpful, please let us know.
About the real form URL, you can post that information publicly or you can private message (PM) that to one of our support staff. I’ve confirmed that PMs are enabled for your community login. Please keep in mind that only one person can see the PM and this will likely mean a slower reply than posting the information publicly. Please feel free to reply to however you prefer though.
Hi, @neil-morgan. I don’t know how this unresolved topic slipped through the cracks but I’m replying now.
I took a look and I think I’ve found the root cause. The form submission is using a form-name value of “contact”. However, no such form is defined in the site HTML:
An HTML only version of the form is a requirement and there is more about this in the following support guide:
If you create a pure HTML-only version of that form somewhere, that will cause the forms processing to create the form handlers so the AJAX submissions will work as expected.
If there are any other questions about this, please let us know.