ericlbarnes / Statamic-email-form

Email form plugin for Statamic
http://ericlbarnes.com/blog/statamic-email-form-plugin
Other
36 stars 6 forks source link

Multiple forms in the same page #18

Closed migswd closed 6 years ago

migswd commented 11 years ago

I want to make 2 forms on the same page. The problem is when I post one form, both forms are posted. Do you have an idea how I could distinct multiple forms on same page ?? Thanks.

ericlbarnes commented 11 years ago

This is kind of hard to debug. Do you think you could create a gist of your rendered HTML ? 

Eric Barnes

On Thu, Aug 22, 2013 at 6:18 AM, Miguel Bocquier notifications@github.com wrote:

I want to make 2 forms on the same page. The problem is when I post one form, both forms are posted. Do you have an idea how I could distinct multiple forms on same page ??

Thanks.

Reply to this email directly or view it on GitHub: https://github.com/ericbarnes/Statamic-email-form/issues/18

seanwash commented 10 years ago

Hey @ericbarnes,

I can confirm this as I'm experiencing the same issue. Here's a gist of the rendered HTML. https://gist.github.com/seanwash/c38b98455e37c2b27696

I'll keep working on this in the mean time. Thanks for a killer plugin!

ericlbarnes commented 10 years ago

I wonder if it's because both forms are missing an "action" attribute. So if you hit submit on one it's sending both.

seanwash commented 10 years ago

Plausible. I searched google for a bit and saw people saying that having separate actions would fix a page with two forms.

ericlbarnes commented 10 years ago

Yeah that's really what I'm thinking. Or use js to send the post and then preventDefault() on the click action.

Give the action a try and see if that works. If not report back and I will try and duplicate this.