404 response when submitting via AJAX

Hi, just setup my first form but getting a 404 response when I try to submit. I don’t want the form to navigate to a new page but just display a success message under the form (which works).

Do I still need to include and action attribute in this scenario that points to the same page?

Link to site:

Hey @hartey11,
One thing that is almost certainly causing problems is this line:

There are spaces before and after the = sign when you encode, which means that your request is sent like this:

Can you try deleting the spaces and let us know if it works any better?

Thanks Jen, that worked. However, I’m getting the css of the name field included in the notification email even though I can’t see it in the payload
Screenshot 2020-09-27 at 10.49.53 am

Screenshot 2020-09-27 at 10.49.17 am

Wow, I’ve never seen before :face_with_monocle: I checked our logs and all looks normal there, so I’m wondering if there is some weird parsing happening as part of the email notification. Was it a one-time thing or are you still seeing it? We did just test this afternoon in case you get a submission from test@netlify.com :slight_smile:

Yep saw your test and it still has the css

Screenshot 2020-10-02 at 6.21.36 pm

hey there,

i did some digging and found these two older threads that seem to similar:


maybe @jonathantoday has some ideas?

Still no luck resolving this?

Also is it possible to amend the notification subject line? I’d ideally like to reply to customers from it but the subject isn’t very useful to them.

Hey @hartey11,
We’re sending what we see as the label for the name field. I don’t know the details of dynamic css in Gatsby but the {" "} after the span tags seem to be the culprit here:

Do you need the quotation marks? Wondering if we’re interpreting that as a string when it’s actually a style. At any rate, if you update that, our emails to you should also update accordingly.

You can update the subject line by creating an input field with name="subject". More on that in our docs here:

Note, however, that you cannot remove [Netlify] from the subject line at this time- that is a long-running feature request that we certainly invite you to add your name to over here → How to remove [Netlify] from subject? - #12 by codyduval