Insert form multiple times on one page
-
Hi,
I noticed that inserting multiple forms with the same ID don’t work because of the validation. Ex. required fields(type input) have all the same name value (name=”text-1″), so it validates all inputs of the inserted form. This way it will never submit.
I think making the name value dynamic wouldn’t be a problem for a form with the same ID (text-11, text-12, etc ), but the actual email contents is based on using the actual value (ex. text-1). So, how would this be overcome?!
Maybe when doing something with the ID of the form and use this as the name value (ex. text-75) and then in the email contents enter it like [text-75$]. This way you could create some logic to dynamically add a sequence to the tag.
The only thing that left is: How to determine what form belongs to which content section?
If you could use the title value of the form you could determine for what content it is.
So, you have this [contact-form-7 id=”75″ title=”product info request”].
Assuming that the ID of the above is leading, you could insert multiple forms with the same ID and change the title value when inserting it as a shortcode.[contact-form-7 id=”75″ title=”product 01 info request”]
[contact-form-7 id=”75″ title=”product 02 info request”]
[contact-form-7 id=”75″ title=”product 03 info request”]If the title value can be used in the email contents as a tag (ex. [wpcf7-title]) then the same submitted forms could be identified by this value when they arrive in your emailbox.
Hope this gives you some ideas for upcoming development of your plugin.
Regards,
Marcellino
- The topic ‘Insert form multiple times on one page’ is closed to new replies.