Form Module: Multiple Forms on Single Page
Created 1 year ago by finnito

Hey,

I've got multiple forms on a single web page (see https://canterburyplumbing.co.nz) and when, for example, the Quote form is submitted, the submission is duplicated and I receive two identical emails.

How can I stop this from occurring?

Thanks!

finnito  —  1 year ago Best Answer
ryanthompson  —  1 year ago

Just set the prefix on the form like ...setOption('prefix', 'form_1_')...

finnito  —  1 year ago

I tried to do this but it didn't seem to do anything like this when using it like this: {{ forms_display('contact').setOption("id", "contact_form")|raw }} because the form still just looks like:

<form method="POST" action="https://canterburyplumbing.co.nz" accept-charset="UTF-8" class="form" enctype="multipart/form-data">
...
</form>

Oh and {{ forms_display('contact').setOption("prefix", "contact_form")|raw }} doesn't seem to do anything either

finnito  —  1 year ago Best Answer