PopupMaker / Popup-Maker

Popup Maker plugin for WordPress
https://wppopupmaker.com/
104 stars 40 forks source link

Attempt to add instance identification to Formidable forms integration #880

Open danieliser opened 3 years ago

danieliser commented 3 years ago

GForms does things nearly the same way, early on I had to tag forms presubmission with the extra data I needed.

So in this case based on all that I've seen and your test results I'd do something like this

  1. During init of our site JS check for Formidable forms on the page.
  2. If they are detected, loop over them getting unique form ID's in most efficient way.
  3. Loop over form IDs and and select all forms using that ID.
  4. For each form with ID x add a data-form-instance="x" attribute via .data('form-instance', x).

Then post submission since the container is still on the page unmodified you should be able to get that instance ID via .data('form-instance').

fpcorso commented 3 years ago

@danieliser Our Gravity Forms integration also does not pass form instance to the form submission process: https://github.com/PopupMaker/Popup-Maker/blob/master/assets/js/src/integration/gravityforms.js#L20

Should we create another issue for adding instance identification to the Gravity Forms integration?

danieliser commented 3 years ago

@fpcorso - We probably should make an issue for it, but I don't think these need to be priorities for now, they are not blocking anything else and on their own aren't super useful. Once we have something that uses them it would make since to make the investment. I initially did so with the others because it was just available data. I didn't have a use for that data at the time but I can see it being useful at some point.