I received:
**test3 firefox desk**
11:42 AM (9 minutes ago)
Name
test3 firefox desk
Email
t@t.com
Received today at 11:42 AM from 122.199.59.246
and I believe that every time the Netlify ‘success’ page appears it correctly indicates a successful submission (I never get it with FF or Edge).
Do you recommend:
application/x-www-form-urlencoded
or
multipart/form-data
for the encoding?
Or perhaps I can’t change that on the client side?
If the answer is doesn’t matter then there’s nothing further I can do and a Netlify fix will be required. If it does make a difference I can change to multipart/form-data although, even if it works, a Netlify fix might still be the better option to cover these situations …
Excellent, that was my expectation.
It does submit successfully for me with Firefox, hence why I provided my specific Firefox version.
The form encodings are referenced in the documentation here:
https://docs.netlify.com/forms/setup/
Netlify’s recommendation is:
If the form accepts alphanumeric data only, the request should include the header "Content-Type": "application/x-www-form-urlencoded"
. If the form accepts file uploads, including a Content-Type
header is not recommended.
It’s down to how you define the form or the ajax request if you’re submitting via JavaScript.
SOLVED. Cached data in the app was preventing the Netlify success page from appearing and with it the correct processing of the form.
When I clear the cache on FF the form submission succeeds.
My netlify.toml is now updated to more aggressively clear the cache:
[headers]]
for = "/*"
[headers.values]
Content-Security-Policy = <various scripts>
Cache-Control = "no-store, no-cache, must-revalidate, max-age=0"
Access-Control-Allow-Origin = "*"
Access-Control-Allow-Methods = "GET, POST, PUT, DELETE, OPTIONS"
Access-Control-Allow-Headers = "Content-Type, Authorization"
[[headers]]
for = "/thank-you.html"
[headers.values]
Cache-Control = "no-store, no-cache, must-revalidate, max-age=0"
[[headers]]
for = "/schedule.html"
[headers.values]
Cache-Control = "no-store, no-cache, must-revalidate, max-age=0"
[[headers]]
for = "/proxy/*"
[headers.values]
Cache-Control = "no-store"
[[redirects]]
from = "/proxy/*"
to = "/.netlify/functions/proxy"
status = 200
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[build]
functions = "netlify/functions"
publish = "."
[[plugins]]
package = "@netlify/plugin-functions-install-core"
It’s working as expected now.
Thanks for your prompt assistance in helping me to narrow down the issue …