leowebguy/simple-mailchimp

Argument 1 does not implement interface HTMLFormElement.

Closed this issue · 1 comments

Using the example whilst including the # for the ID gives a null error
document.getElementById('#mailchimp')

When I remove the # I get a Uncaught TypeError: FormData constructor: Argument 1 does not implement interface HTMLFormElement. error in the console

Seems to relate to this issue

I tried to change body: new FormData(form) to be more specific but then I get the Mailchimp error: Invalid Resource error like this

I would appreciate any guidance here as I am a bit lost!

Get the reference to the form directly with this:
body: new FormData(e.target)