B
B
Boris Shpakovsky2019-09-03 14:53:44
JavaScript
Boris Shpakovsky, 2019-09-03 14:53:44

How to identify the same CF7 form in a modal window called by different triggers?

There are multiple goals: 1. click on the modal window trigger 2. Sending the CF7 form ( wpcf7mailsent )
The form on the page is called the same, but the triggers are different. That is, you can give triggers identifiers and match them with targets.
And here's the question, how to divide the form submission events according to the same principle? That is, to see in the metric what trigger the modal window was called before submitting the form and so that this event does not fall into neighboring targets with a similar chain of events. Or is it easier to make multiple forms and call different forms on different triggers?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tyzberd, 2019-09-03
@tyzberd

you can set different ids for window mods, and in the wpcf7mailsent event check which window the form is in and send it to different targets

A
Anatoly Kulikov, 2019-09-03
@anatoly_kulikov

We need some variable that will denote the trigger. By default, it will be empty.
When the trigger button is clicked, the key is written to the variable, the value of the variable is entered into the hidden input of the form. It's like that's all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question