Has anyone had successfully implemented Netlify Forms using google’s amp-form element?
I’m having trouble with migrating Netlify forms on the site to amp HTML. More specific, is it possible to have Netlify forms return a JSON object instead of redirect?
Hey there, @doodanroo
I see this thread has been a bit quiet since you posted it! Are you still trouble with this? Have you started by reading our Forms Docs and Forms Debugging Support Guide?
If you have already read those and are still encountering issues, please share the following information if you are able to:
- The URL for your live form as you want visitors to use it
- The form name that you’ve set and that shows in our UI
- Any errors or logs from the Netlify build logs, dashboard or browser developer console
- Description of anything you have tried that did or didn’t help or make things better/worse
I came across the same problem. amp-form expects a JSON response and errors on redirect. See the browser log below.
amp.js:130 Powered by AMP ⚡ HTML – Version 2104170104001 https://www.nvt.app/
log.js:254 [amp-form] Failed to parse response JSON: SyntaxError: Unexpected token < in JSON at position 0
ub @ log.js:254
g.Ta @ log.js:309
g.error @ log.js:326
(anonymous) @ amp-form.js:1002
Pc @ amp-form.js:996
(anonymous) @ amp-form.js:752
Jc @ amp-form.js:751
(anonymous) @ amp-form.js:714
(anonymous) @ amp-form.js:673
xc @ amp-form.js:668
(anonymous) @ amp-form.js:528
push.f.m.Ha @ amp-form.js:380
cg @ action-impl.js:733
g.execute @ action-impl.js:449
Uh @ document-submit.js:161
Also, it does not allow
action form attribute as it’s using
The form submission seems to work but there’s no way to notify the user. I’m using Next.js + AMP.
Hi @alyx ! I don’t recommend using amp-form element on Netlify sites atm it you won’t be able to receive submissions.