We use a form that pops up if a button is clicked and can be filled out. Is there any way to indicate which page someone was on when I received the form? If they’re on an Events page and want to be contacted vs. on another page like Home.
Yes. Create a hidden field for the URL path, and use a small piece of script to set its value on page load, to the current page path.
If you’re not sure how, PM me next week when I’m back at my desk, I’ve been thinking of adding /path capture as a feature to WFU, along with cookie capture.
I haven’t looked into how to do your response yet, and I should have specified this differently, but we have a page on our site where a handful of different places to click that make this form pop up. I’d want to indicate which one they clicked on the page. They’re all linked to a Collection, is there any way to have like the collection name attached to the form in a similar way that you said you could do the URL path? Thank you!
Yes however that scenario is a fair bit trickier, because if you’re creating your modals using interactions and a click trigger you don’t have any where to insert your code that adds the form data payload.
You can probably have two JS triggers on the same button without any conflicts- one would be Webflow’s IX2 trigger, one would be your own trigger to insert the form value.
I haven’t tried this so you might encounter some weirdness with IX2, but I’d generally expect it to work without much difficulty.
A simple custom code idea…
- Set a listener to the click on the class of the button.
- set the function in order to grab the tittle of the box eg “financial…”
- Set the value of an hidden field in the form with this tittle
It’s a few line in jQuery and there is no risk of conflict with Webflow script in this case.